Reputation: 2341
This seems like a project setup problem in someway. This was working previously. I don't have the knowledge that these error messages help me to start. Does anyone have some advice on where to start diagnosing the problem?
21 05 2017 07:42:55.094:WARN [karma]: No captured browser, open http://localhost:9876/
21 05 2017 07:42:55.110:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9876/
21 05 2017 07:42:55.110:INFO [launcher]: Launching browser Chrome with unlimited concurrency
21 05 2017 07:42:55.118:INFO [launcher]: Starting browser Chrome ERROR in /Users/jgreenaw/WebstormProjects/legalcoveapp/node_modules/@angular/core/src/testability/testability.d.ts (41,33): Cannot find name 'Node'.
ERROR in /Users/jgreenaw/WebstormProjects/legalcoveapp/node_modules/@angular/forms/src/directives/ng_form.d.ts (69,22): Cannot find name 'Event'.
ERROR in /Users/jgreenaw/WebstormProjects/legalcoveapp/node_modules/@angular/forms/src/directives/reactive_directives/form_group_directive.d.ts (74,22): Cannot find name 'Event'.
ERROR in /Users/jgreenaw/WebstormProjects/legalcoveapp/node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.d.ts (58,26): Cannot find name 'KeyboardEvent'.
ERROR in /Users/jgreenaw/WebstormProjects/legalcoveapp/node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead.d.ts (81,26): Cannot find name 'KeyboardEvent'.
Upvotes: 4
Views: 1200
Reputation: 3149
If running karma test from your IDE (for example, IntelliJ IDEA) and your solution doesn't build/has lint errors, karma seems to not connect and just hang.
Run your tests with something like ng test
and get that working before running from your IDE.
Upvotes: 0
Reputation: 7893
After upgrading my Angular lib versions, my Karma tests too started to fail which led me to the this question. After verifying the @angular/cli versions, now 1.1.2, match between global and the local project the following may also be required:
Update your src/tsconfig.spec.json by adding "dom" to the lib array:
"lib": ["es2016", "dom"],
Upvotes: 5
Reputation: 2341
I was able to move forward past the problem, but not identify the root cause by doing the following.
npm cache clean
npm install
Thanks @MatthewDaly for the useful suggestions and questions.
Upvotes: 0