This is what fixed it for me:
I searched the whole project for occurrences of HttpClientModule
in all *.spec.ts
files. Turned out I had a few!
Then I replaced all occurrences of
import { HttpClientModule } from '@angular/common/http';
with
import { HttpClientTestingModule } from '@angular/common/http/testing';
And then I made sure that the entry in the imports
array of each of my test's TestBed.configureTestingModule
was changed from HttpClientModule
to HttpClientTestingModule
.
And finally I turned my Wifi off and ran the tests again. And voilà: It worketh!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…