forked from vitest-dev/vitest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: inherit concurrent/sequential in nested suites (vitest-dev#4482)
- Loading branch information
1 parent
8b9c541
commit 77a5683
Showing
6 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { describe, expect, test, vi } from 'vitest' | ||
|
||
vi.setConfig({ | ||
sequence: { | ||
concurrent: true, | ||
}, | ||
}) | ||
|
||
const delay = (timeout: number) => new Promise(resolve => setTimeout(resolve, timeout)) | ||
|
||
let count = 0 | ||
|
||
describe.sequential('running sequential suite when sequence.concurrent is true', () => { | ||
test('first test completes first', async ({ task }) => { | ||
await delay(50) | ||
expect(task.concurrent).toBeFalsy() | ||
expect(++count).toBe(1) | ||
}) | ||
|
||
test('second test completes second', ({ task }) => { | ||
expect(task.concurrent).toBeFalsy() | ||
expect(++count).toBe(2) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters