Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot run npm run test on Chrome or PhantomJS #4654
I have almost fresh new project based on:
When I am trying to run npm run test with defaults, I am getting.
wird is that in npm run start everything works fine including routings, since I have impoterd in imports RouterModule in app.module.ts.
So I've tried to change to PhantomJS by installing:
In Karma i added:
and I am getting
I added also in pollyfills.ts (after npm run install --save-dev intl)
but still I cannot run tests, any ideas?
@ruffiem now I am getting on PhantomJS
This is not a CLI problem. This is an Angular testing StackOverflow type question.
In testing, you get a testing module that is different from your normal module. That's why
Check the component that has
And in the actual test:
Please check the official testing guide for more:
Same issue here with Angular2 CLI and Phantom.
Solved thanks to @ruffiem but for me worked uncomenting just:
Edit: needed to uncomment
added a commit
Mar 30, 2017
referenced this issue
Apr 11, 2017
I have enabled all the polyfills and change es5 as target, but still getting the the DOM Exception error