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

Replace jsdom-global with global-jsdom #760

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

just-boris
Copy link
Contributor

When trying to use jsdom-global with React tests, you will see these warnings in the console:

This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills

This package does not expose these functions. However, there is a modern fork, global-jsdom which offers the same API, but also exports all global DOM APIs properly.

I propose changing the mention to the new package, as it is a more future-proof option.

cc @modosc who is maintaining global-jsdom

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsdom-global doesn't seem to be maintained anymore. The issue regarding rAF hasn't received any response in 2 years: rstacruz/jsdom-global#45

@MatanBobi
Copy link
Member

MatanBobi commented Feb 14, 2021

jsdom-global doesn't seem to be maintained anymore. The issue regarding rAF hasn't received any response in 2 years: rstacruz/jsdom-global#45

If that's the case, I'm +1 on merging this :)
Thanks @just-boris for taking the time!

Copy link
Member

@nickmccurdy nickmccurdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They also explicitly use the MIT license, nice suggestion.

@nickmccurdy nickmccurdy merged commit 4f1014c into testing-library:master Feb 14, 2021
@modosc
Copy link
Contributor

modosc commented Feb 14, 2021

sounds good - i just explicitly enabled pretendToBeVisual by default in the 8.0.0.beta release which provides those apis. i'll probably bump it up to an official release this week unless i hear back from anyone about it (the other changes are related to .esm support).

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

Successfully merging this pull request may close these issues.

None yet

5 participants