New to Angular 2 and trying to create a model for an Angular 2 app that is a migration from Java to TypeScript. The tests we are recreating are "isolated" tests as specified in the testing guide.
Encountered Issue:
After adding an isolated test, all Angular 2 tests fail with similar errors in Karma:
Chrome 59.0.3071 (Windows 10 0.0.0) Home should have a title FAILED
Failed: Unexpected value 'HomeComponent' declared by the module 'DynamicTestModule'. Please add a @Pipe/@Directive/@Component annotation.
Error: Unexpected value 'HomeComponent' declared by the module 'DynamicTestModule'. Please add a @Pipe/@Directive/@Component annotation.
at syntaxError ......
...snip...
The error logs can be found in the GitHub repository: https://github.com/Nava2/angular-starter/tree/master/src/app. The complete log output is available in this gist: this gist.
WebStorm tree structure can be viewed here: https://i.sstatic.net/e1O2p.png
Removing the isolated test resolves the Angular 2 test errors.
Steps to Reproduce:
- Clone this fork: https://github.com/Nava2/angular-starter
- Run npm install
- Run npm run test
If I remove app/model/entity.no-testbed.spec.ts, the errors go away. Unsure why they occur. Seeking guidance on the correct development approach to avoid wasting time.
Misc Information
- Operating System: Windows 10
- Node Version: v8.1.2