Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

undefined is not a constructor (evaluating 'expect(element.hasClass('selected')).toBe(true)') #14629

Closed
Lorac opened this issue May 18, 2016 · 1 comment

Comments

@Lorac
Copy link

Lorac commented May 18, 2016

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
This is the issue : http://stackoverflow.com/questions/37265774/undefined-is-not-a-constructor-angularjs-directive-testing

I think it is related with : #14251

I am using all the same versions of everything for angular.

What is the expected behavior?
Not to fail

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.

1.5.5

Other information (e.g. stacktraces, related issues, suggestions how to fix)

 undefined is not a constructor (evaluating 'expect(element.hasClass('selected')).toBe(true)')
/client/app/card/card.directive.spec.es5.js:19:46
invoke@/client/bower_components/angular/angular.js:4665:24
workFn@/client/bower_components/angular-mocks/angular-mocks.js:2965:26
inject@/client/bower_components/angular-mocks/angular-mocks.js:2931:28
/client/app/card/card.directive.spec.es5.js:14:67
global code@/client/app/card/card.directive.spec.es5.js:3:9
@gkalpak
Copy link
Member

gkalpak commented May 18, 2016

According to #14251 (comment), "undefined is not a constructor" is PhantomJS' way of saying that you are trying to call something that is not a function.

Unfortunately, we can't investigate this any further without a reproduction.
I'm going to close this as it is not actionable in its current state, but feel free to re-open if you can provide the necessary info.

@gkalpak gkalpak closed this as completed May 18, 2016
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