Skip to content

Instantly share code, notes, and snippets.

@thiagoa
Last active November 7, 2016 23:38
Show Gist options
  • Save thiagoa/42c92936448bdadf3153486cfcbe94e8 to your computer and use it in GitHub Desktop.
Save thiagoa/42c92936448bdadf3153486cfcbe94e8 to your computer and use it in GitHub Desktop.
const httpStatusCode = 200;
const contentType = { 'Content-Type': 'application/json' };
const serverResponse = JSON.stringify({ foo: 'bar' });
const server = sinon.fakeServer.create();
server.respondWith('GET', '/my/endpoint', [
httpStatusCode, contentType, serverResponse
]);
performRequest();
server.respond();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment