Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

PhantomJS2 giving tons of ZoneAwareError on Angular-CLI 4.0.0 #14993

Closed
wethinkagile opened this issue May 15, 2017 · 2 comments
Closed

PhantomJS2 giving tons of ZoneAwareError on Angular-CLI 4.0.0 #14993

wethinkagile opened this issue May 15, 2017 · 2 comments

Comments

@wethinkagile
Copy link

	ZoneAwareError@webpack:///~/zone.js/dist/zone.js:999:0 <- src/polyfills.ts:3096:28
	webpack:///src/shared/calc/calc.service.spec.ts:38:35 <- src/test.ts:40927:35
	invoke@webpack:///~/zone.js/dist/zone.js:365:0 <- src/polyfills.ts:2462:31
	onInvoke@webpack:///~/zone.js/dist/proxy.js:79:0 <- src/test.ts:105610:45
	invoke@webpack:///~/zone.js/dist/zone.js:364:0 <- src/polyfills.ts:2461:40
	run@webpack:///~/zone.js/dist/zone.js:125:0 <- src/polyfills.ts:2222:49
	webpack:///~/zone.js/dist/jasmine-patch.js:104:0 <- src/test.ts:105326:37
	execute@webpack:///~/zone.js/dist/jasmine-patch.js:132:0 <- src/test.ts:105354:46
	execute@webpack:///~/zone.js/dist/jasmine-patch.js:132:0 <- src/test.ts:105354:46
	execute@webpack:///~/zone.js/dist/jasmine-patch.js:132:0 <- src/test.ts:105354:46
	webpack:///~/zone.js/dist/jasmine-patch.js:129:91 <- src/test.ts:105351:134
	invokeTask@webpack:///~/zone.js/dist/zone.js:398:0 <- src/polyfills.ts:2495:36
	runTask@webpack:///~/zone.js/dist/zone.js:165:0 <- src/polyfills.ts:2262:57
	drainMicroTaskQueue@webpack:///~/zone.js/dist/zone.js:593:0 <- src/polyfills.ts:2690:42
	invoke@webpack:///~/zone.js/dist/zone.js:464:0 <- src/polyfills.ts:2561:44

These are only thrown when we have a failing test, but these outputs (on every test) make it very hard to find the desired test failure message. Any ideas?

@whyboris
Copy link

whyboris commented Jul 24, 2017

Possibly related: angular/angular-cli#6583

In Angular, the testing output differs significantly between Chrome and PhantomJS, for example (using Angular 4.3.1 and Angular CLI 1.2.3):

Output in console when browsers: ['Chrome'], in karma.conf.js:

Chrome 59.0.3071 (Mac OS X 10.12.4) HashtagsComponent onSelect(hashtag) should update hashtag based on input FAILED
        Expected false to be true.
            at Object.<anonymous> Users/boris/Desktop/publish/src/app/compose/hashtags/hashtags.component.spec.ts:116:34)
            at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke Users/byakubchik/Desktop/forbespress2/publish/node_modules/zone.js/dist/zone.js:391:1)
            at ProxyZoneSpec.webpackJsonp.../../../../zone.js/dist/proxy.js.ProxyZoneSpec.onInvoke Users/byakubchik/Desktop/forbespress2/publish/node_modules/zone.js/dist/proxy.js:79:1)
            at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke Users/byakubchik/Desktop/forbespress2/publish/node_modules/zone.js/dist/zone.js:390:1)

(note hashtags.component.spec.ts is present in output, where the failed test occurs)

Output when browsers: ['PhantomJS'], in karma.conf.js:

PhantomJS 2.1.1 (Mac OS X 0.0.0) HashtagsComponent onSelect(hashtag) should update hashtag based on input FAILED
        Expected false to be true.
        http://localhost:9876/_karma_webpack_/main.bundle.js:5192:44
        invoke@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2769:31
        onInvoke@http://localhost:9876/_karma_webpack_/vendor.bundle.js:72353:45
        invoke@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2768:40
        run@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2519:49
        http://localhost:9876/_karma_webpack_/vendor.bundle.js:72232:37
        http://localhost:9876/_karma_webpack_/vendor.bundle.js:126773:31
        invoke@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2769:31
        onInvoke@http://localhost:9876/_karma_webpack_/vendor.bundle.js:71769:45
        onInvoke@http://localhost:9876/_karma_webpack_/vendor.bundle.js:72350:47
        invoke@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2768:40
        run@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2519:49
        http://localhost:9876/_karma_webpack_/vendor.bundle.js:126768:28
        http://localhost:9876/_karma_webpack_/vendor.bundle.js:71758:46
        invokeTask@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2802:36
        runTask@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2569:57
        invoke@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:2864:45
        timer@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:3918:34

for the same failed test!

@whyboris
Copy link

whyboris commented Jul 24, 2017

For others using Angular and facing the same problem, I found a simple 30 second solution by moving to Chrome Headless.
Easy to do -- just a small change to karma.conf.js
Instructions: http://cvuorinen.net/2017/05/running-angular-tests-in-headless-chrome/

ps - PhantomJS hasn't had a new release since January 2016

@ghost ghost closed this as completed Jan 29, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants