Skip to content
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

TypeError: Cannot read properties of undefined (reading 'equals') with Jasmine 4.2 #63

Closed
joonass-visma opened this issue Jun 29, 2022 · 4 comments

Comments

@joonass-visma
Copy link

When trying to run our tests with Jasmine 4.2, I get the following error:

TypeError: Cannot read properties of undefined (reading 'equals')

The error is coming from util-patch.js:

function matchersUtilPatched(j$) {
  var util = j$.matchersUtil;
  var oldEquals = util.equals.bind(util); // <--- crashes here because util is undefined
...

According to Jasmine 4 upgrade notes jasmine.matchersUtil is deprecated and apparently has been removed now.

@mradionov
Copy link
Owner

Thanks for letting me know, I'll see what I can do.

@valentinoavon
Copy link

It would be amazing if this can be fixed, we need this to update to jasmine 4!
Thank you for your work!

@mradionov
Copy link
Owner

I've played around with it a little bit, and I was not able to find a proper solution to fix the error. Jasmine developers have reworked the globals that I could take advantage of before 4.x, but now I can't figure out how to work around it.

It was a very "hacky" project because I was overriding their internal stuff, so it was a matter of time until it stopped working.

I don't think I'll be making it work again (if it's even possible). I no longer have the motivation to work on it. It was a cool project when I started it and hopefully, it helped people a little bit with their tests :)

I'll update the README and maybe add a stdout warning that it does not support Jasmine 4.x.

@mradionov
Copy link
Owner

I've published a new version of the plugin 3.0.0 that will auto-disable the plugin and display a warning in the karma output if it detects that Jasmine 4.x is used. Also added a section at the top of README explaining it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants