angular-webpack-starter icon indicating copy to clipboard operation
angular-webpack-starter copied to clipboard

yarn test failing

Open Justus-Maier opened this issue 7 years ago • 2 comments

Unit Test(s) are broken (fresh clone) since the ngx/store integration, please fix.

SUMMARY:
V 0 tests completed
× 1 test failed

FAILED TESTS:
  App Component
    × should contain app text
      Chrome 64.0.3282 (Windows 7 0.0.0)
      StaticInjectorError(Platform: core)[AppComponent -> Store]:
        NullInjectorError: No provider for Store!
    Error: StaticInjectorError(DynamicTestModule)[AppComponent -> Store]:
        at _NullInjector../node_modules/@angular/core/esm5/core.js._NullInjector.get(webpack:///node_modules/@angular/core/esm5/core.js:1002:0 <- test-config/spec-bundle.js:66684:19)

Justus-Maier avatar Apr 04 '18 11:04 Justus-Maier

The Injector Error can be solved by importing StoreModule(.forRoot) into the TestBed, but I'm unsure about the configuration, the router-outlet is empty then.

Justus-Maier avatar Apr 04 '18 12:04 Justus-Maier

Maybe it would be possible to add even more tests to get a good coverage with this starter right from the beginning? Watch mode configuration for TDD is well done and working including coverage reports!

Justus-Maier avatar Apr 04 '18 13:04 Justus-Maier