-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
🌈 Feature
Right now the tests run in the same JavaScript/DOM environment as the app. This can lead to unexpected and pretty confusing results which I (and other maintainers/contributors) have to explain over and over again to people reporting issues to react-testing-library.
Here's a simple example: https://codesandbox.io/s/n3j6r28z10
We have to tell people that they need to NOT render anything in their index.js file to avoid the issues which is annoying, inconvenient, and confusing.
I think it would make a lot of sense to run the tests in an iframe. And maybe provide a codesandbox option to run the tests with jsdom rather than the browser DOM (this would simulate local reality better for create-react-app based codesandboxes).
kentcdodds, dirigible37, cilice, ghoullier, donavon and 32 more