[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

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

Co-authored-by: Dor Alagem <doralagem@MacBook-Pro-sl-Dor.local>
Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com>

authored by

Dor Alagem
Dor Alagem
Hiroshi Ogawa
and committed by
GitHub
(Apr 25, 2026, 3:11 PM +0900) db67831d e3cb1928

+14 -4
+4 -4
packages/runner/src/suite.ts
··· 707 707 } 708 708 709 709 suiteFn.for = function <T>( 710 - this: { 711 - withContext: () => SuiteAPI 712 - setContext: (key: string, value: boolean | undefined) => SuiteAPI 713 - }, 710 + this: SuiteAPI, 714 711 cases: ReadonlyArray<T>, 715 712 ...args: any[] 716 713 ) { 714 + const context = getChainableContext(this) 715 + const suite = context.withContext() 716 + 717 717 if (Array.isArray(cases) && args.length) { 718 718 cases = formatTemplateString(cases, args) 719 719 }
+10
test/core/test/test-for-suite.test.ts
··· 33 33 expect(a + b).matchSnapshot() 34 34 }) 35 35 }) 36 + 37 + // Regression test: describe.concurrent.for should propagate the concurrent flag 38 + // to the generated suites, matching how describe.for and test.concurrent.for behave. 39 + describe.concurrent.for([1, 2])('concurrent %i', (item) => { 40 + test('is marked concurrent', ({ task }) => { 41 + expect(task.suite!.concurrent).toBe(true) 42 + expect(task.concurrent).toBe(true) 43 + expect(item).toBeGreaterThan(0) 44 + }) 45 + })