Skip to content

Instantly share code, notes, and snippets.

@stevermeister
Created July 2, 2017 19:04
Show Gist options
  • Save stevermeister/003e8d71d525c6209a4f129d01da8334 to your computer and use it in GitHub Desktop.
Save stevermeister/003e8d71d525c6209a4f129d01da8334 to your computer and use it in GitHub Desktop.
it('should get one user', inject([XHRBackend], (mockBackend: MockBackend) => {
mockBackend.connections.subscribe((connection: MockConnection) => {
mockUser = { name: 'John', age: 21 };
const responseOptions = new ResponseOptions({ body: JSON.stringify(mockUser) });
connection.mockRespond(new Response(responseOptions));
})
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment