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

clearImmediate is not defined error when using new v7.29.5 via cypress #899

Closed
kschiffer opened this issue Feb 19, 2021 · 4 comments
Closed

Comments

@kschiffer
Copy link

  • @testing-library/dom version: 7.29.5
  • Testing Framework and version: cypress 4.11.0
  • DOM Environment:
    Cypress Chrome 88

Relevant code or config:

Running any cypress test that uses @testing-library/cypress.

What you did:

Running cypress tests which worked before the update.

What happened:

 1) An uncaught error was detected outside of a test:
     ReferenceError: The following error originated from your test code, not from Cypress.

  > clearImmediate is not defined

Reproduction:

Running any cypress test that uses @testing-library/cypress.

Problem description:

The error originates from here: ac9a6b7#diff-49ba0c85360693b8e89ae0e0428284a55db749f08f2b9993d26910def646e02fR13

It appears like dom-testing-library assumes that clearImmediate and setImmediate are globally available, but it appears to be available in Internet Explorer 10 only.

Suggested solution:

I don't have time to look into why setImmediate is used in the first place, but I suppose that setImmediate needs to be removed or at least polyfilled before dom-testing-library uses it in the global scope.

@kschiffer kschiffer changed the title clearImmediate is not defined error when using dom-testing-library via cypress clearImmediate is not defined error when using new dom-testing-library v7.29.5 via cypress Feb 19, 2021
@kschiffer kschiffer changed the title clearImmediate is not defined error when using new dom-testing-library v7.29.5 via cypress clearImmediate is not defined error when using new v7.29.5 via cypress Feb 19, 2021
@eps1lon
Copy link
Member

eps1lon commented Feb 19, 2021

Thanks for the report.

Could you try if this still happens with @testing-library/dom@7.29.6 ?

If the issue persists then we would need a reproduction to debug the issue. A link to a repository on GitHub, or provide a minimal code example that reproduces the problem.

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

@JBWatenbergScality
Copy link

Hello,

I had a similar issue and I confirm that by upgrading @testing-library/dom to 7.29.6 it solves it.

Thanks for the fix !

@eps1lon
Copy link
Member

eps1lon commented Feb 22, 2021

Waiting for @kschiffer to confirm or if there's no response within 7 days.

@kschiffer
Copy link
Author

I can confirm that the issue is resolved. Thanks for the swift action and for this awesome library <3.

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

No branches or pull requests

3 participants