Skip to content

Commit 1277dc1

Browse files
authored
feat!: run suite hooks in a stack (#5609)
1 parent ed60e40 commit 1277dc1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/guide/migration.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ outline: deep
55

66
# Migration Guide
77

8-
## Migrating from Vitest 0.34.6
8+
## Migrating to Vitest 2.0
9+
10+
### Hooks are running in a stack
11+
12+
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.
13+
14+
You can revert to the previous behaviour by changing [`sequence.hooks`](/config/#sequence-hooks) to `'parallel'`.
15+
16+
## Migrating to Vitest 1.0
917

1018
<!-- introduction -->
1119

packages/vitest/src/node/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ export function resolveConfig(
513513
? RandomSequencer
514514
: BaseSequencer
515515
}
516-
resolved.sequence.hooks ??= 'parallel'
516+
resolved.sequence.hooks ??= 'stack'
517517
if (resolved.sequence.sequencer === RandomSequencer)
518518
resolved.sequence.seed ??= Date.now()
519519

0 commit comments

Comments
 (0)