Created
August 17, 2017 19:00
-
-
Save dherges/d109cce85eb203ce74a1f5d73a0abcc3 to your computer and use it in GitHub Desktop.
Angular HttpClient (4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe(`FakeHttpClientResponses`, () => { | |
it(`should respond with fake data`, async(inject([HttpClient, HttpTestingController], | |
(http: HttpClient, backend: HttpTestingController) => { | |
http.get('/foo/bar').subscribe((next) => { | |
expect(next).toEqual({ baz: '123' }); | |
}); | |
backend.match({ | |
url: '/foo/bar', | |
method: 'GET' | |
})[0].flush({ baz: '123' }); | |
}))); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment