diff --git a/packages/runner/src/suite.ts b/packages/runner/src/suite.ts index 36b830f92f55..bbdf068e4211 100644 --- a/packages/runner/src/suite.ts +++ b/packages/runner/src/suite.ts @@ -286,9 +286,11 @@ function createSuite() { if (currentSuite?.options) options = { ...currentSuite.options, ...options } - // inherit concurrent / sequential from current suite - options.concurrent = this.concurrent || (!this.sequential && options?.concurrent) - options.sequential = this.sequential || (!this.concurrent && options?.sequential) + // inherit concurrent / sequential from suite + const isConcurrent = options.concurrent || (this.concurrent && !this.sequential) + const isSequential = options.sequential || (this.sequential && !this.concurrent) + options.concurrent = isConcurrent && !isSequential + options.sequential = isSequential && !isConcurrent return createSuiteCollector(formatName(name), factory, mode, this.shuffle, this.each, options) } diff --git a/test/core/test/concurrent-suite.test.ts b/test/core/test/concurrent-suite.test.ts index 56bac82a7818..11c8bc2d9a3d 100644 --- a/test/core/test/concurrent-suite.test.ts +++ b/test/core/test/concurrent-suite.test.ts @@ -119,10 +119,9 @@ describe('override concurrent', { concurrent: true }, () => { checkSequentialTests() }) - // TODO: not working? - // describe('s-x-2', { sequential: true, }, () => { - // checkSequentialTests() - // }) + describe('s-x-2', { sequential: true }, () => { + checkSequentialTests() + }) describe('s-y', () => { checkParallelTests()