0
I’m trying to perform unit tests in Angular, but I have some problems with injection dependencies in the services. In the application there are several services that depend on each other, for example:
- Service A is dependent on Service B
- Service B is dependent on Service C
- Service C is dependent on Service D
- Service D is dependent on Httpclient and Angular Router
Due to these multiple dependency levels I cannot perform the injection of providers into the test class. It was raised the possibility of creating mocks for the services, but due to the amount of dependencies it would be necessary to create a mock for each service.
Is there any way to facilitate injection of dependencies into services?
you’re using jest or karma?
– Eduardo Vargas
I’m using karma
– Mauricio Hartmann