โ ๏ธ Breaking Change
Impact Score: 7/10
Vitest v0.10.0 โ Release Notes & Engineering Impact
Source available โ automated, not human-reviewed
Component: vitest ยท Channel: stable. Automated analysis, not a compatibility certification. How this works.
Analysis updated: 2026-11-01.
Breaking-change evidence from the source
Breaking Changes From Vitest v0.10.0, the callback style of declaring tests is deprecated. You can rewrite them to use `async`/`await` functions, or use Promise to mimic the callback style.
โก Executive Summary (TL;DR)
Vitest v0.10.0. Source highlight: From Vitest v0.10.0, the callback style of declaring tests is deprecated. You can rewrite them to use `async`/`await` functions, or use Promise to mimic the callback style.
Who Does This Impact? (Role-Based Analysis)
๐ป Software Engineers & Devs
Check the source notes against the package and APIs you use before upgrading.
๐ Product & Engineering Leads
Use the documented changes to assess relevance to your product; release frequency alone is not a quality measure.
โ๏ธ DevOps & Security
Verify the target version, runtime requirements and rollback procedure in the official documentation.
โ ๏ธ Breaking Changes & Deprecations (1)
- Breaking Changes From Vitest v0.10.0, the callback style of declaring tests is deprecated. You can rewrite them to use `async`/`await` functions, or use Promise to mimic the callback style.
๐ง Bug Fixes & Patches (1)
- types for EachFunction are missing awaitable return (fix: #1181) (#1182) (95b1ba4)
๐ View Raw Release Notes (Original Developer Log)
## Breaking Changes
From Vitest v0.10.0, the callback style of declaring tests is deprecated. You can rewrite them to use `async`/`await` functions, or use Promise to mimic the callback style.
```diff
- it('should work', (done) => {
+ it('should work', () => new Promise(done => {
// ...
done()
- })
+ }))
```
## Features
### `beforeAll` / `beforeEach` cleanup callback
`beforeAll` / `beforeEach` now accepts an optional cleanup function as the return value (equivalent to `afterAll` / `afterEach`).
```ts
import { beforeAll } from 'vitest'
beforeEach(async () => {
// called once before each test run
await startMocking()
// clean up function, called once after each test run
return async () => {
await stopMocking()
}
})
```
Learn more at:
- [`beforeAll`](https://vitest.dev/api/#beforeall)
- [`beforeEach`](https://vitest.dev/api/#beforeeach)
### Test Context
Inspired by [Playwright Fixtures](https://playwright.dev/docs/test-fixtures), Vitest's test context allows you to define utils, states, and fixtures that can be used in your tests.
```ts
import { beforeEach, it } from 'vitest'
beforeEach((context) => {
// extend context
context.foo = 'bar'
})
it('should work', ({ foo }) => {
console.log(foo) // 'bar'
})
```
Learn more at [Test Context](https://vitest.dev/guide/test-context)
### Concurrent Snapshot
Due to the limitation of JavaScript, timing based Singleton pattern will cause conflicts when running multiple async functions in concurrent. Previously reported as [#551](https://github.com/vitest-dev/vitest/issues/551). Thanks to the newly introduced [Test Context](#test-context), we can now provide a test specific `expect` instance to avoid conflicts. To use it, you can destructure the `expect` from each test context instead of the global one.
```ts
test.concurrent('test 1', async ({ expect }) => {
expect(foo).toMatchSnapshot()
})
test.concurrent('test 2', async ({ expect }) => {
expect(foo).toMatchSnapshot()
})
```
### Reporter from file / package
Now you can pass a path to file, or a package name to the `reporters` options to use custom reporter. Thanks to [@ericjgagnon](https://github.com/ericjgagnon) ([#1136](https://github.com/vitest-dev/vitest/issues/1136)) ([f2bceb2](https://github.com/vitest-dev/vitest/commit/f2bceb2))
## Bug Fixes
* types for EachFunction are missing awaitable return (fix: [#1181](https://github.com/vitest-dev/vitest/issues/1181)) ([#1182](https://github.com/vitest-dev/vitest/issues/1182)) ([95b1ba4](https://github.com/vitest-dev/vitest/commit/95b1ba4))