I'm testing an angular 4 service with a dependency on the Http service. The testing guide suggests using isolated unit tests where the service instance is created with the new keyword:
beforeEach(() => { service = new FancyService(); });
But when FancyService uses the Http service, I get the error
Supplied parameters do not match any signature of call target.
This makes sense as the Http service is in the FancyService constructor. So I add a new Http instance as below, but I get the same error.
beforeEach(() => { service = new FancyService(new Http())})
How can I make my service available in the tests?
FancyServicehas a function returninghttp.get(.... So in the test I've just importedHttpfrom@angular/httpand plugged it in as above.