-
Notifications
You must be signed in to change notification settings - Fork 711
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
Usage with Jest's test.concurrent.each
#1091
Comments
jest.concurrent.each
jest.concurrent.each
test.concurrent.each
It's expected that it doesn't work in the normal configuration because we render into the global You would have to create isolated containers for each test. We should probably add explicit documentation for how to achive that. |
test.concurrent.each
test.concurrent.each
Thanks, that make sense! For reference, how would I create isolated containers for each test? |
https://jestjs.io/docs/configuration#testenvironment-string One approach could be to use a custom environment that creates a new JSDOM global in |
@testing-library/dom
version: 13.3.0Relevant code or config:
What you did:
I have a set of tests that are relying on jest's
test.concurrent
feature, and I would like to be able to run these concurrently usingtest.concurrent.each
. Just switching fromtest.concurrent
totest.concurrent.each
doesn't seem to work.What happened:
The render method seems to add these to the same JSDOM document, causing issues with e.g.
getByTestId
Reproduction:
See code snippet on top, or this repository: https://github.com/jimmycallin/rtl-concurrent-each
Problem description:
test.concurrent.each
is a supported feature in jest, and it would be great to be able to run multiple testing-library tests in parallel using this feature.Suggested solution:
The text was updated successfully, but these errors were encountered: