DEV Community

Discussion on: Angular series: Creating an authentication service with TDD

Collapse
 
frankfullstack profile image
Frank

Hi, great post :). I found that you need to import in your auth.service.spec.ts the HttpClientTestingModule in order to use the HttpClient on the spyObj.

Collapse
 
jpblancodb profile image
JPBlancoDB

Hi Frank! Thanks for reading! Could you put your test file? I'm curious why you needed to import that. Is it possible that you are using TestBed.configureTestingModule in your service tests? If that is the case, indeed you need to import HttpClientTestingModule, if not is not needed.

Thank you again!