angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.54k stars 3k forks source link

Upgrading version 1.0.6 to 1.0.11 breaks Karma test runner #3576

Closed sedkis closed 6 years ago

sedkis commented 6 years ago

This is a:

My version of UI-Router is: (version) 1.0.6 & 1.0.11

Bug Report

Current Behavior:

karma test is breaking when trying to upgrade to UI-Router 1.0.11. Karma test is working fine on UI-Router 1.0.6

On version 1.0.11

Karma output: image

Angular-ui-router function: image

I do not think the issue is related to Karma. Just posting it for context. I think it is a bug in the UI router code.

edit: I've run through the versions backwards from 1.0.11, and 1.0.8 is where it starts to work. ie 1.0.9 is the first failing version.

sedkis commented 6 years ago

Can anyone look at this?

christopherthielen commented 6 years ago

The bug isn't in ui-router (we run tons of unit tests), it's in PhantomJS. Update your phantomjs package to latest and it should work. The change is related to using Function.prototype, which apparently isn't supported in phantomjs 1.9.8 (Which is pretty old)

sedkis commented 6 years ago

@christopherthielen , you were right. I updated the PhantomJS version and it worked. How did you know that? Was it just the context and the fact that PhantomJS spit out the log?

christopherthielen commented 6 years ago

@sabousha I just happened to remember that phantomjs updated its ecmascript support (to ES5, maybe?) in the 2.x release. We're using phantomjs 2.x to run the ui-router unit tests and it doesn't have any trouble with Function.prototype. I saw PhantomJS 1.9.8 in your log and it stood out to me as the culprit

sedkis commented 6 years ago

Good call. Thanks! Starred!