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

hasClass with regex parameter breaks on jenkins and not locally #2245

Closed
2 of 13 tasks
reenan opened this issue Sep 27, 2019 · 1 comment
Closed
2 of 13 tasks

hasClass with regex parameter breaks on jenkins and not locally #2245

reenan opened this issue Sep 27, 2019 · 1 comment

Comments

@reenan
Copy link

reenan commented Sep 27, 2019

Current behavior

I have the following test:
expect(alignCenter.find('.card-item-tooltip').hasClass(/(left|right)/)).toBeFalsy();
It works fine and pass when running locally (macOS, node 12).

On jenkins when running the tests (linux, node12) this test fails with TypeError: className.indexOf is not a function.

Expected behavior

Same output locally and on jenkins

Your environment

Local: macOS, node 12
Jenkins: linux, node 12

API

  • shallow
  • mount
  • render

Version

library version
enzyme "^3.9.0"
react "^16.8.6"
react-dom "^16.8.6"
react-test-renderer "^16.8.6"
adapter (below) "^1.11.2"

Adapter

  • enzyme-adapter-react-16
  • enzyme-adapter-react-16.3
  • enzyme-adapter-react-16.2
  • enzyme-adapter-react-16.1
  • enzyme-adapter-react-15
  • enzyme-adapter-react-15.4
  • enzyme-adapter-react-14
  • enzyme-adapter-react-13
  • enzyme-adapter-react-helper
  • others ( )
@ljharb
Copy link
Member

ljharb commented Sep 27, 2019

The implication is that you're not installing the same versions of enzyme and enzyme things in those two places; this was an issue that was fixed in #2057 and released in v3.10.0 of enzyme.

In other words, this is a duplicate of #2057, and you can fix it by updating enzyme.

@ljharb ljharb closed this as completed Sep 27, 2019
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

2 participants