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

Enable pretendToBeVisual by default #97

Closed
just-boris opened this issue Feb 7, 2021 · 3 comments
Closed

Enable pretendToBeVisual by default #97

just-boris opened this issue Feb 7, 2021 · 3 comments

Comments

@just-boris
Copy link

just-boris commented Feb 7, 2021

This flag enables requestAnimationFrame method, which is a requirement for running React in the testing environment.

Currently I need to do the following:

require('global-jsdom')(undefined, { pretendToBeVisual: true });

It would be great to make global-jsdom/register doing this by default.

@modosc
Copy link
Owner

modosc commented Feb 9, 2021

thanks for the issue - i'm torn about changing this behavior by default since there'd be no easy way to opt out.

otoh - it would be nice for some variation of import 'global-jsdom/register / -r global-jsdom/register to support this out of the box. maybe a new entry point global-jsdom/register-visual ? i have to rethink the register code anyway due to #84 so i'll churn on this too.

@modosc
Copy link
Owner

modosc commented Feb 10, 2021

i realized i'm already setting some default options and making a major release with breaking changes so i went ahead and added this in too. i just published 8.0.0.beta2 with this change.

@modosc modosc closed this as completed Feb 10, 2021
@just-boris
Copy link
Author

Very nice, thank you!

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

No branches or pull requests

2 participants