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

expect(...).toBeVisible is not a function #2390

Closed
noomorph opened this issue Oct 5, 2020 · 4 comments · Fixed by #2391
Closed

expect(...).toBeVisible is not a function #2390

noomorph opened this issue Oct 5, 2020 · 4 comments · Fixed by #2391

Comments

@noomorph
Copy link
Collaborator

noomorph commented Oct 5, 2020

Description

After upgrading to jest@26.5.x and jest-circus@26.5.x, all Detox tests began failing with:

TypeError: expect(...).toBeVisible is not a function

Expected behavior

Detox should initialize its global variables correctly, i.e.: Jest's expect should not shadow the Detox's expect.

Actual behavior

CustomDetoxEnvironment sets Detox globals and matchers including this.global.expect, but then, a few moments later the Detox's expect gets overwritten with Jest's one.

Screenshots

image

See: jestjs/jest#10484

@noomorph
Copy link
Collaborator Author

noomorph commented Oct 5, 2020

Temporary solution

Lock your jest and jest-circus dependencies to 26.4.x, like demonstrated here:

image

@noomorph noomorph changed the title urgent: expect(...).toBeVisible is not a function bug(jest): expect(...).toBeVisible is not a function Oct 5, 2020
@noomorph noomorph changed the title bug(jest): expect(...).toBeVisible is not a function bug(jest-circus): expect(...).toBeVisible is not a function Oct 5, 2020
@LeoNatan LeoNatan changed the title bug(jest-circus): expect(...).toBeVisible is not a function expect(...).toBeVisible is not a function Oct 5, 2020
@LeoNatan
Copy link
Contributor

LeoNatan commented Oct 5, 2020

Can we catch this and throw an error?

@noomorph
Copy link
Collaborator Author

noomorph commented Oct 5, 2020

Catch what and which error do you want to throw, could you elaborate pls? I'll check in the morning

@LeoNatan
Copy link
Contributor

LeoNatan commented Oct 5, 2020

If jest is above the version we support.

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

Successfully merging a pull request may close this issue.

3 participants