After Angular 14 Upgrade Every Single Unit Test Fails, "NullInjectorError: No Provider For HTTPClient!"

66 views Asked by At

I upgraded my project from Angular v13 to v14 using the "ng update" command. Everything seemed fine, but now EVERY unit test that has anything to do with HttpClient fail.

"NullInjectorError: No Provider For HTTPClient!"

Did they completely change the syntax for Angular testing altogether in Angular v14??

I'm getting injector errors for @ngrx/store, routing, and httpclient... literally everything is broken.

Dependency injection is basically the only difference between Angular and regular javascript so it's very sad to see how buggy and broken it is.

Does anyone have a working example of a unit test for a component that loads a service that uses HttpClient? I would be amazed to see something like this in Angular v14 that actually works.

Thanks

0

There are 0 answers