-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Describe the bug
the test code like below:
describe.sequential('sum', () => {
beforeAll(() => {
console.log('before all +++')
})
afterAll(() => {
console.log('after all ++++')
})
beforeEach(()=> {
console.log('before each')
})
afterEach(() => {
console.log("after each")
})
test('1+2=3', async () => {
expect(sum(1, 2)).toEqual(3);
console.log('123')
});
});
while the output like below:
vitest run
RUN v2.1.8 /home/projects/vitejs-vite-bju16tjp
stdout | src/sum.test.ts > sum > 1+2=3
before each
123
after eachstdout | src/sum.test.ts > sum
before all +++
after all ++++✓ src/sum.test.ts (1)
✓ sum (1)
✓ 1+2=3
does not the beforeAll hook should run before all test case?
Reproduction
you could reproduce this issue with : this example
System Info
System:
OS: Linux 5.0 undefined
CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^5.4.8 => 5.4.11
vitest: ^2.1.8 => 2.1.8Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable