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.
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!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
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!