respond-ng
Simple Mocking API for Angular 2's Http Service
To use, install respond-ng with npm:
npm install respond-ng --save-dev
Import the providers and Respond:
;
Create an injector, then use the injector to get an instance of Respond and the service you are testing:
; beforeEach;
Write simple response mocks using Respond's fluent API:
it'should check if the user is authenticated', ;
After each test, verify there are no outstanding requests:
afterEachrespond.verifyComplete;
For more information, see docs for Respond and RequestMatcher. Happy testing!