PhantomJS/Chrome fails in Karma test with “Zonenat”/“Script error” in an Angular 6 project
up vote
0
down vote
favorite
Hi people of the StackOverflow,
I am stuck! My ng test
fails, although ng serve
builds and compiles this Angular 6 project with no issues. The error I am getting is the following:
Additionally, immediately after that Chrome fails, just as so:
I have little to no understanding of what's happening, but this issue prevents the successful deploy, as the build-street fails.
As a big noob I am furiously going in a loop of trying to apply solutions that closely resembles my issue, but with no avail. That is why I am asking you guys for help! I've tried doing PhantomJS does not work with Karma in Angular2 project; put import 'zone.js/dist/zone'
from polyfills.ts in the top of the file; updating PhantomJS and what not.
My karma.conf.js is as follows:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
/*...*/
browsers: ['Chrome', 'PhantomJS'],
singleRun: true
});
};
Don't know if it'll help but my package.json looks like this:
{
"name": "isms-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"prepare": "patch-package"
},
"private": true,
"dependencies": {
"@angular/animations": "6.1.8",
"@angular/cdk": "^6.4.7",
"@angular/common": "6.1.8",
"@angular/compiler": "6.1.8",
"@angular/core": "6.1.8",
"@angular/forms": "6.1.8",
"@angular/http": "6.1.8",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "6.1.8",
"@angular/platform-browser-dynamic": "6.1.8",
"@angular/router": "6.1.8",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"ngx-window-core": "^1.0.84",
"rxjs": "6.3.2",
"rxjs-compat": "6.3.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular-devkit/build-ng-packagr": "~0.8.0",
"@angular/cli": "~6.2.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"ng-packagr": "^4.1.0",
"phantomjs-prebuilt": "^2.1.16",
"patch-package": "^5.1.1",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.29.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
}
Please let me know if any more information can help resolve this issue. Thanks in advance for your time!
angular google-chrome phantomjs karma-jasmine zone
add a comment |
up vote
0
down vote
favorite
Hi people of the StackOverflow,
I am stuck! My ng test
fails, although ng serve
builds and compiles this Angular 6 project with no issues. The error I am getting is the following:
Additionally, immediately after that Chrome fails, just as so:
I have little to no understanding of what's happening, but this issue prevents the successful deploy, as the build-street fails.
As a big noob I am furiously going in a loop of trying to apply solutions that closely resembles my issue, but with no avail. That is why I am asking you guys for help! I've tried doing PhantomJS does not work with Karma in Angular2 project; put import 'zone.js/dist/zone'
from polyfills.ts in the top of the file; updating PhantomJS and what not.
My karma.conf.js is as follows:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
/*...*/
browsers: ['Chrome', 'PhantomJS'],
singleRun: true
});
};
Don't know if it'll help but my package.json looks like this:
{
"name": "isms-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"prepare": "patch-package"
},
"private": true,
"dependencies": {
"@angular/animations": "6.1.8",
"@angular/cdk": "^6.4.7",
"@angular/common": "6.1.8",
"@angular/compiler": "6.1.8",
"@angular/core": "6.1.8",
"@angular/forms": "6.1.8",
"@angular/http": "6.1.8",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "6.1.8",
"@angular/platform-browser-dynamic": "6.1.8",
"@angular/router": "6.1.8",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"ngx-window-core": "^1.0.84",
"rxjs": "6.3.2",
"rxjs-compat": "6.3.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular-devkit/build-ng-packagr": "~0.8.0",
"@angular/cli": "~6.2.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"ng-packagr": "^4.1.0",
"phantomjs-prebuilt": "^2.1.16",
"patch-package": "^5.1.1",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.29.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
}
Please let me know if any more information can help resolve this issue. Thanks in advance for your time!
angular google-chrome phantomjs karma-jasmine zone
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Hi people of the StackOverflow,
I am stuck! My ng test
fails, although ng serve
builds and compiles this Angular 6 project with no issues. The error I am getting is the following:
Additionally, immediately after that Chrome fails, just as so:
I have little to no understanding of what's happening, but this issue prevents the successful deploy, as the build-street fails.
As a big noob I am furiously going in a loop of trying to apply solutions that closely resembles my issue, but with no avail. That is why I am asking you guys for help! I've tried doing PhantomJS does not work with Karma in Angular2 project; put import 'zone.js/dist/zone'
from polyfills.ts in the top of the file; updating PhantomJS and what not.
My karma.conf.js is as follows:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
/*...*/
browsers: ['Chrome', 'PhantomJS'],
singleRun: true
});
};
Don't know if it'll help but my package.json looks like this:
{
"name": "isms-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"prepare": "patch-package"
},
"private": true,
"dependencies": {
"@angular/animations": "6.1.8",
"@angular/cdk": "^6.4.7",
"@angular/common": "6.1.8",
"@angular/compiler": "6.1.8",
"@angular/core": "6.1.8",
"@angular/forms": "6.1.8",
"@angular/http": "6.1.8",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "6.1.8",
"@angular/platform-browser-dynamic": "6.1.8",
"@angular/router": "6.1.8",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"ngx-window-core": "^1.0.84",
"rxjs": "6.3.2",
"rxjs-compat": "6.3.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular-devkit/build-ng-packagr": "~0.8.0",
"@angular/cli": "~6.2.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"ng-packagr": "^4.1.0",
"phantomjs-prebuilt": "^2.1.16",
"patch-package": "^5.1.1",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.29.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
}
Please let me know if any more information can help resolve this issue. Thanks in advance for your time!
angular google-chrome phantomjs karma-jasmine zone
Hi people of the StackOverflow,
I am stuck! My ng test
fails, although ng serve
builds and compiles this Angular 6 project with no issues. The error I am getting is the following:
Additionally, immediately after that Chrome fails, just as so:
I have little to no understanding of what's happening, but this issue prevents the successful deploy, as the build-street fails.
As a big noob I am furiously going in a loop of trying to apply solutions that closely resembles my issue, but with no avail. That is why I am asking you guys for help! I've tried doing PhantomJS does not work with Karma in Angular2 project; put import 'zone.js/dist/zone'
from polyfills.ts in the top of the file; updating PhantomJS and what not.
My karma.conf.js is as follows:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
/*...*/
browsers: ['Chrome', 'PhantomJS'],
singleRun: true
});
};
Don't know if it'll help but my package.json looks like this:
{
"name": "isms-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"prepare": "patch-package"
},
"private": true,
"dependencies": {
"@angular/animations": "6.1.8",
"@angular/cdk": "^6.4.7",
"@angular/common": "6.1.8",
"@angular/compiler": "6.1.8",
"@angular/core": "6.1.8",
"@angular/forms": "6.1.8",
"@angular/http": "6.1.8",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "6.1.8",
"@angular/platform-browser-dynamic": "6.1.8",
"@angular/router": "6.1.8",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"ngx-window-core": "^1.0.84",
"rxjs": "6.3.2",
"rxjs-compat": "6.3.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular-devkit/build-ng-packagr": "~0.8.0",
"@angular/cli": "~6.2.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"ng-packagr": "^4.1.0",
"phantomjs-prebuilt": "^2.1.16",
"patch-package": "^5.1.1",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.29.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
}
Please let me know if any more information can help resolve this issue. Thanks in advance for your time!
angular google-chrome phantomjs karma-jasmine zone
angular google-chrome phantomjs karma-jasmine zone
edited Nov 22 at 0:22
asked Nov 22 at 0:16
Maksim Dimitrov
4318
4318
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
After all the suffering I found out that all I had to do is pass an argument to ng test
, just as ng test isms-frontend
in my case. Found the answer from jorgjanke last comment from https://github.com/angular/angular-cli/issues/12581
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
After all the suffering I found out that all I had to do is pass an argument to ng test
, just as ng test isms-frontend
in my case. Found the answer from jorgjanke last comment from https://github.com/angular/angular-cli/issues/12581
add a comment |
up vote
0
down vote
accepted
After all the suffering I found out that all I had to do is pass an argument to ng test
, just as ng test isms-frontend
in my case. Found the answer from jorgjanke last comment from https://github.com/angular/angular-cli/issues/12581
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
After all the suffering I found out that all I had to do is pass an argument to ng test
, just as ng test isms-frontend
in my case. Found the answer from jorgjanke last comment from https://github.com/angular/angular-cli/issues/12581
After all the suffering I found out that all I had to do is pass an argument to ng test
, just as ng test isms-frontend
in my case. Found the answer from jorgjanke last comment from https://github.com/angular/angular-cli/issues/12581
answered Nov 22 at 19:05
Maksim Dimitrov
4318
4318
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422223%2fphantomjs-chrome-fails-in-karma-test-with-zone-nat-script-error-in-an-angula%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown