-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Description
Describe the bug
It seems that describe.concurrent.each is implemented as a shortcut for setting { concurrency: true } in each describe block so the tests within it are run in concurrently.
However, this is not how it works in Jest according to this PR: jestjs/jest#9326
describe.concurrent.each should not alter the describe block options but execute each describe block concurrently.
Here are my expectations:
const cases = [1, 2, 3];
// full concurrency, both the describe blocks and the tests within them are run concurrently
describe.concurrent.each(cases)(
`case: %i`,
{ concurrent: true },
(num) => {
test("foo", {});
test("bar", {});
}
);
// only the describe blocks are executed concurrently, the tests within them are executed serially
describe.concurrent.each(cases)(
`case: %i`,
(num) => {
test("foo", {});
test("bar", {});
}
);
// the describe blocks are executed serially, the tests within them are executed concurrently
describe.each(cases)(
`case: %i`,
{ concurrent: true },
(num) => {
test("foo", {});
test("bar", {});
}
);Reproduction
I was not able to install vitest correctly in StackBlitz:
❯ npm install
npm ERR! Failed to fetch dependencies:
npm ERR! - yocto-queue@1.0.0
npm ERR! - queue-microtask@1.2.3
npm ERR! A complete log of this run can be found in: /home/.npm/_logs/2024-03-29T17_44_21_075Z-debug-0.log
But here is the link illustrating the issue: https://stackblitz.com/edit/vitest-dev-vitest-fwwzec?file=test%2Fbasic.test.ts
System Info
System:
OS: macOS 14.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 88.14 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - /nix/store/xjgg53kjjhwcx4p3dmywjmqjbv82xhyn-nodejs-20.11.1/bin/node
npm: 10.2.4 - /nix/store/xjgg53kjjhwcx4p3dmywjmqjbv82xhyn-nodejs-20.11.1/bin/npm
pnpm: 8.15.5 - /nix/store/ih6qr7ga6i467b91kf52lkb6qhiib4s8-corepack-enable/bin/pnpm
Browsers:
Chrome: 123.0.6312.87
Safari: 17.4.1
npmPackages:
vitest: 1.4.0 => 1.4.0Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Type
Projects
Status
Has plan