qdouble / angular-webpack-starter

A complete Angular 6 and Webpack 4 starter seed with minimal and full featured branches. Full featured branch includes: Material Design 2 (Bootstrap 4 branch available as well), @ngrx, HMR, DLLs and optional use of Universal for server-side rendering - Supports AOT (offline) compilation, sync and lazy loading. Karma/Protractor for e2e/unit tests.
MIT License
883 stars 181 forks source link

yarn test failing #327

Open Justus-Maier opened 6 years ago

Justus-Maier commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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!