Skip to content

Commit a20e75b

Browse files
authored
fix(runner): Ensure inner suite { sequential: true } correctly overrides outer suite { concurrent: true } (#5737)
1 parent 1ec61ce commit a20e75b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/runner/src/suite.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,11 @@ function createSuite() {
286286
if (currentSuite?.options)
287287
options = { ...currentSuite.options, ...options }
288288

289-
// inherit concurrent / sequential from current suite
290-
options.concurrent = this.concurrent || (!this.sequential && options?.concurrent)
291-
options.sequential = this.sequential || (!this.concurrent && options?.sequential)
289+
// inherit concurrent / sequential from suite
290+
const isConcurrent = options.concurrent || (this.concurrent && !this.sequential)
291+
const isSequential = options.sequential || (this.sequential && !this.concurrent)
292+
options.concurrent = isConcurrent && !isSequential
293+
options.sequential = isSequential && !isConcurrent
292294

293295
return createSuiteCollector(formatName(name), factory, mode, this.shuffle, this.each, options)
294296
}

test/core/test/concurrent-suite.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ describe('override concurrent', { concurrent: true }, () => {
119119
checkSequentialTests()
120120
})
121121

122-
// TODO: not working?
123-
// describe('s-x-2', { sequential: true, }, () => {
124-
// checkSequentialTests()
125-
// })
122+
describe('s-x-2', { sequential: true }, () => {
123+
checkSequentialTests()
124+
})
126125

127126
describe('s-y', () => {
128127
checkParallelTests()

0 commit comments

Comments
 (0)