Skip to content

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

Closed
@kschiffer

Description

@kschiffer
  • @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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions