Skip to content

Commit

Permalink
docs(api): add docs for test.sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyddall committed Nov 16, 2023
1 parent 98632af commit 493da27
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,30 @@ test.concurrent('test 2', async ({ expect }) => {
You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types).
:::

### test.sequential

- **Type:** `(name: string | Function, fn: TestFunction, timeout?: number) => void`

`test.sequential` marks a test as sequential. This is useful if you want to run tests in sequence within `describe.concurrent` or with the `--sequence.concurrent` command option.

```ts
// with config option { sequence: { concurrent: true } }
test('concurrent test 1', async () => { /* ... */ })
test('concurrent test 2', async () => { /* ... */ })

test.sequential('sequential test 1', async () => { /* ... */ })
test.sequential('sequential test 2', async () => { /* ... */ })

// within concurrent suite
describe.concurrent('suite', () => {
test('concurrent test 1', async () => { /* ... */ })
test('concurrent test 2', async () => { /* ... */ })

test.sequential('sequential test 1', async () => { /* ... */ })
test.sequential('sequential test 2', async () => { /* ... */ })
})
```

### test.todo

- **Type:** `(name: string | Function) => void`
Expand Down

0 comments on commit 493da27

Please sign in to comment.