-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run npm run test on Chrome or PhantomJS #4654
Comments
@zwolej you need to uncomment those from your polyfills.ts
|
@ruffiem now I am getting on PhantomJS
chrome
|
Also, you do not have to import |
uncomment |
As for |
I uncommented all core-js/es6 imports. Now I am getting on phantomjs and chrome
I would like only remind that npm run start works great. I can easly naviagte and so on using those routerLinks |
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: Cheers, |
Thanks! I didnt used TestBed.createComponent in tests before. Work like a charm. |
Same issue here with Angular2 CLI and Phantom.
Solved thanks to @ruffiem but for me worked uncomenting just:
Edit: needed to uncomment |
Unit testing with CSS errors - Failed: undefined is not a constructor (evaluating 'suffix.startsWith('{' + BLOCK_PLACEHOLDER)') To get around this, add polyfills as per angular/angular-cli#4654
I have enabled all the polyfills and change es5 as target, but still getting the the DOM Exception error
Angular version @angular/cli: 1.0.1 any idea? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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?
The text was updated successfully, but these errors were encountered: