Skip to content

Commit

Permalink
feat!: run suite hooks in a stack (#5609)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored May 6, 2024
1 parent ed60e40 commit 1277dc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/guide/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ outline: deep

# Migration Guide

## Migrating from Vitest 0.34.6
## Migrating to Vitest 2.0

### Hooks are running in a stack

Before Vitest 2.0, all hooks were running in parallel. In 2.0, all hooks run serially. In addition to this, `afterAll`/`afterEach` are running in a reverse order.

You can revert to the previous behaviour by changing [`sequence.hooks`](/config/#sequence-hooks) to `'parallel'`.

## Migrating to Vitest 1.0

<!-- introduction -->

Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ export function resolveConfig(
? RandomSequencer
: BaseSequencer
}
resolved.sequence.hooks ??= 'parallel'
resolved.sequence.hooks ??= 'stack'
if (resolved.sequence.sequencer === RandomSequencer)
resolved.sequence.seed ??= Date.now()

Expand Down

0 comments on commit 1277dc1

Please sign in to comment.