Skip to content

fix(runner): propagate chainable flags in describe.for#10187

Merged
hi-ogawa merged 3 commits intovitest-dev:mainfrom
DORI2001:fix/describe-concurrent-for
Apr 25, 2026
Merged

fix(runner): propagate chainable flags in describe.for#10187
hi-ogawa merged 3 commits intovitest-dev:mainfrom
DORI2001:fix/describe-concurrent-for

Conversation

@DORI2001
Copy link
Copy Markdown
Contributor

Closes #10181

Problem

describe.concurrent.for (and other chainable modifiers like .only, .skip) were not being propagated to the generated suites.

suiteFn.each correctly calls getChainableContext(this).withContext() to capture any chained flags before iterating. suiteFn.for was missing this — it referenced the outer suite variable directly, so modifiers like concurrent were silently dropped.

Fix

Apply the same pattern used in suiteFn.each:

const context = getChainableContext(this)
const suite = context.withContext()

This ensures that describe.concurrent.for, describe.only.for, describe.skip.for, etc. all behave consistently.

Test

Added a regression test to test/core/test/test-for-suite.test.ts that verifies task.suite.concurrent is true when using describe.concurrent.for.

describe.concurrent.for (and other chainable modifiers like .only, .skip)
were not being propagated to the generated suites because suiteFn.for
was using the outer `suite` variable directly instead of calling
getChainableContext(this).withContext() like suiteFn.each does.

Fixes vitest-dev#10181
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 550eb61
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/69eb86cc0eafef0008858b54
😎 Deploy Preview https://deploy-preview-10187--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

hi-ogawa
hi-ogawa previously approved these changes Apr 25, 2026
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hi-ogawa hi-ogawa merged commit db67831 into vitest-dev:main Apr 25, 2026
15 of 16 checks passed
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

Successfully merging this pull request may close these issues.

describe.concurrent.for doesn't enable concurrent

2 participants