-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
The "BeforeAll" works later than "it.concurrent", but must work before #4281
Comments
that's not possible right now. const dataPromise = getSomeDataPromise();
test.concurrent('one', async () => {
const data = await dataPromise;
});
test.concurrent('two', async () => {
const data = await dataPromise;
}); this way they'll wait on the same promise that will be executed before everything |
@aaronabramov are there any plans on supporting it though? How about |
@jeffijoe not in the nearest future. |
@aaronabramov Is this issue added to backlog ? appreciate your response |
I am wondering why |
@yxliang01 I believe it simply hasn't been documented there. It is mentioned here, however: https://jestjs.io/docs/en/cli#maxconcurrency-num
|
Why is this closed if it's not fixed? |
This comment has been minimized.
This comment has been minimized.
Issue persists, please reopen |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'd like to run my Jest tests concurrently, but I'm having issues with one scenario:
I'm testing the results on an endpoint, and I want to test multiple things about it. So in my beforeAll function, I make the request and store the response, and then I test the response in multiple tests. This works fine synchronously, but when I make the tests concurrent, it no longer lets you pass a variable into the test, so it's a no go. Alternatively, I can put the request in the test itself and then expect many things about the response, but then I don't have the granularity to see what went wrong if something fails.
Is there any solution for this scenario?
Additional check (the BeforeAll worked after test.concurrent)
Result:
$ jest
PASS ..\1.test.js
√
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.938s
Ran all test suites.
console.log ..\1.test.js:8
start it.concurrent
console.log ..\1.test.js:4
start beforeAll
The text was updated successfully, but these errors were encountered: