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

Jest: MutationObserver is not a constructor #724

Closed
jantimon opened this issue May 20, 2020 · 1 comment
Closed

Jest: MutationObserver is not a constructor #724

jantimon opened this issue May 20, 2020 · 1 comment
Labels
kind: support Asking for support with something or a specific use case scope: dependencies Pull requests that update a dependency file solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue

Comments

@jantimon
Copy link

Can we please upgrade jest to fix this problem?
testing-library/react-testing-library#662

@agilgur5
Copy link
Collaborator

agilgur5 commented May 23, 2020

As that issue says, you need to supply some polyfill or configure JSDOM. You can already do that in Jest 24. I do not know what versions of JSDOM support MutationObserver, but if you want to use JSDOM 16, you can install and configure jest-environment-jsdom-sixteen per the docs.

A breaking upgrade for Jest 25 and a few other deps is already slated for v0.14.0 and there is already a PR for it. Jest 25 uses JSDOM 15 by default however, not 16, so I do not know if that supports your use case or not.
Jest 26 is still very recent and support is TBD because it also requires TS 3.8+ which breaks a number of dependencies

@agilgur5 agilgur5 added solution: duplicate This issue or pull request already exists kind: support Asking for support with something or a specific use case labels May 23, 2020
@agilgur5 agilgur5 added scope: dependencies Pull requests that update a dependency file solution: workaround available There is a workaround available for this issue labels Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: support Asking for support with something or a specific use case scope: dependencies Pull requests that update a dependency file solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

2 participants