Asking for help, clarification, or responding to other answers. - Solved! Add `HttpClientModule` to the @NgModule imports array. Setting "providers". Resolved | Nullinjectorerror: no provider for formbuilder! nullinjectorerror: no provider for httpclient! uni test Code Example Categorized as angular, angular-providers, jasmine, unit-testing Tagged angular, angular-providers, jasmine, unit-testing. nullinjectorerror: no provider for angular test Solution. However, when I run ng test for my unit tests, and when those tests use the service, I am getting the error: Error: StaticInjectorError(DynamicTestModule)[HttpClient]: StaticInjectorError(Platform: core)[HttpClient]: NullInjectorError: No provider for HttpClient! NullInjectorError: No provider for HttpClient! NullInjectorError: No provider for HttpClient! The issue is more due to not registering the required services i.e HttpClientModule in the root module ie. Let's add a new unit test case for testing the openDialog method which utilizes the MatDialog instance to show the modal popup. How to Unit Test an HTTP Service in Angular - Braydon Coyer Testing Utility APIs. NullInjectorError: No provider for HttpClient! In addition, the solution of the errors depends on the error, so it is not only one. The Angular 6 documentation on HTTP just says to do what I did above. 14 days weather beira, mozambique. nullinjectorerror: no provider for service angular 8 Log in, to leave a comment. Everything works fine until I try to use HttpClientModule (successor to HttpModule ). Inject provider into another provider; Latest Posts. How do I flatten an array of arrays? testing Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[ImageService -> HttpClient -> HttpClient -> HttpClient]: NullInjectorError: No provider for HttpClient! 17. nullinjectorerror: no provider for httpclient test NullInjectorError: No provider for HttpClient!