{
- await page.getByRole('button').click()
-})
-```
-
-The modules are identical, so doing a simple "Find and Replace" should be sufficient.
-
-If you were using the `@vitest/browser/utils` module, you can now import those utilities from `vitest/browser` as well:
-
-```ts
-import { getElementError } from '@vitest/browser/utils' // [!code --]
-import { utils } from 'vitest/browser' // [!code ++]
-const { getElementError } = utils // [!code ++]
-```
-
-::: warning
-Both `@vitest/browser/context` and `@vitest/browser/utils` work at runtime during the transition period, but they will be removed in a future release.
-:::
-
-### Pool Rework
-
-Vitest has used [`tinypool`](https://github.com/tinylibs/tinypool) for orchestrating how test files are run in the test runner workers. Tinypool has controlled how complex tasks like parallelism, isolation and IPC communication works internally. However we've found that Tinypool has some flaws that are slowing down development of Vitest. In Vitest v4 we've completely removed Tinypool and rewritten how pools work without new dependencies. Read more about reasoning from [feat!: rewrite pools without tinypool #8705
-](https://github.com/vitest-dev/vitest/pull/8705).
-
-New pool architecture allows Vitest to simplify many previously complex configuration options:
-
-- `maxThreads` and `maxForks` are now `maxWorkers`.
-- Environment variables `VITEST_MAX_THREADS` and `VITEST_MAX_FORKS` are now `VITEST_MAX_WORKERS`.
-- `singleThread` and `singleFork` are now `maxWorkers: 1, isolate: false`. If your tests were relying on module reset between tests, you'll need to add [setupFile](/config/setupfiles) that calls [`vi.resetModules()`](/api/vi.html#vi-resetmodules) in [`beforeAll` test hook](/api/hooks#beforeall).
-- `poolOptions` is removed. All previous `poolOptions` are now top-level options. The `memoryLimit` of VM pools is renamed to `vmMemoryLimit`.
-- `threads.useAtomics` is removed. If you have a use case for this, feel free to open a new feature request.
-- Custom pool interface has been rewritten, see [Custom Pool](/guide/advanced/pool#custom-pool)
-
-```ts
-export default defineConfig({
- test: {
- poolOptions: { // [!code --]
- forks: { // [!code --]
- execArgv: ['--expose-gc'], // [!code --]
- isolate: false, // [!code --]
- singleFork: true, // [!code --]
- }, // [!code --]
- vmThreads: { // [!code --]
- memoryLimit: '300Mb' // [!code --]
- }, // [!code --]
- }, // [!code --]
- execArgv: ['--expose-gc'], // [!code ++]
- isolate: false, // [!code ++]
- maxWorkers: 1, // [!code ++]
- vmMemoryLimit: '300Mb', // [!code ++]
- }
-})
-```
-
-Previously it was not possible to specify some pool related options per project when using [Vitest Projects](/guide/projects). With the new architecture this is no longer a blocker.
-
-::: code-group
-```ts [Isolation per project]
-import { defineConfig } from 'vitest/config'
-
-export default defineConfig({
- test: {
- projects: [
- {
- // Non-isolated unit tests
- name: 'Unit tests',
- isolate: false,
- exclude: ['**.integration.test.ts'],
- },
- {
- // Isolated integration tests
- name: 'Integration tests',
- include: ['**.integration.test.ts'],
- },
- ],
- },
-})
-```
-```ts [Parallel & Sequential projects]
-import { defineConfig } from 'vitest/config'
-
-export default defineConfig({
- test: {
- projects: [
- {
- name: 'Parallel',
- exclude: ['**.sequential.test.ts'],
- },
- {
- name: 'Sequential',
- include: ['**.sequential.test.ts'],
- fileParallelism: false,
- },
- ],
- },
-})
-```
-```ts [Node CLI options per project]
-import { defineConfig } from 'vitest/config'
-
-export default defineConfig({
- test: {
- projects: [
- {
- name: 'Production env',
- execArgv: ['--env-file=.env.prod']
- },
- {
- name: 'Staging env',
- execArgv: ['--env-file=.env.staging']
- },
- ],
- },
-})
-```
-:::
-
-See [Per-File Isolation Settings](/guide/recipes/disable-isolation) and [Parallel and Sequential Test Files](/guide/recipes/parallel-sequential) for more examples.
-
-### Reporter Updates
-
-Reporter APIs `onCollected`, `onSpecsCollected`, `onPathsCollected`, `onTaskUpdate` and `onFinished` were removed. See [`Reporters API`](/api/advanced/reporters) for new alternatives. The new APIs were introduced in Vitest `v3.0.0`.
-
-The `basic` reporter was removed as it is equal to:
-
-```ts
-export default defineConfig({
- test: {
- reporters: [
- ['default', { summary: false }]
- ]
- }
-})
-```
-
-The [`verbose`](/guide/reporters#verbose-reporter) reporter now prints test cases as a flat list. To revert to the previous behaviour, use `--reporter=tree`:
-
-```ts
-export default defineConfig({
- test: {
- reporters: ['verbose'], // [!code --]
- reporters: ['tree'], // [!code ++]
- }
-})
-```
-
-### Snapshots using Custom Elements Print the Shadow Root
-
-In Vitest 4.0 snapshots that include custom elements will print the shadow root contents. To restore the previous behavior, set the [`printShadowRoot` option](/config/snapshotformat) to `false`.
-
-```js{15-22}
-// before Vitest 4.0
-exports[`custom element with shadow root 1`] = `
-"
-
-
-
-"
-`
-
-// after Vitest 4.0
-exports[`custom element with shadow root 1`] = `
-"
-
-
- #shadow-root
-
- hello
-
-
-
-"
-`
-```
-
-### Deprecated APIs are Removed
-
-Vitest 4.0 removes some deprecated APIs, including:
-
-- `poolMatchGlobs` config option. Use [`projects`](/guide/projects) instead.
-- `environmentMatchGlobs` config option. Use [`projects`](/guide/projects) instead.
-- `deps.external`, `deps.inline`, `deps.fallbackCJS` config options. Use `server.deps.external`, `server.deps.inline`, or `server.deps.fallbackCJS` instead.
-- `browser.testerScripts` config option. Use [`browser.testerHtmlPath`](/config/browser/testerhtmlpath) instead.
-- `minWorkers` config option. Only `maxWorkers` has any effect on how tests are running, so we are removing this public option.
-- Vitest no longer supports providing test options object as a third argument to `test` and `describe`. Use the second argument instead:
-
-```ts
-test('example', () => { /* ... */ }, { retry: 2 }) // [!code --]
-test('example', { retry: 2 }, () => { /* ... */ }) // [!code ++]
-```
-
-Note that providing a timeout number as the last argument is still supported:
+### Removed Deprecated Entrypoints
-```ts
-test('example', () => { /* ... */ }, 1000) // ✅
-```
+Several entry points were marked as deprecated in Vitest 4.1. This release removes them entirely.
-This release also removes all deprecated types. This finally fixes an issue where Vitest accidentally pulled in `@types/node` (see [#5481](https://github.com/vitest-dev/vitest/issues/5481) and [#6141](https://github.com/vitest-dev/vitest/issues/6141)).
+- `vitest/coverage`: use `vitest/node` instead
+- `vitest/reporters`: use `vitest/node` instead
+- `vitest/environments`: use `vitest/runtime` instead
+- `vitest/snapshot`: use `vitest/runtime` instead
+- `vitest/runners`: use `TestRunner` from `vitest` instead
+- `vitest/suite`: use static methods on `TestRunner` from vitest instead (for example, `TestRunner.getCurrentTest()`)
+- `vitest/mocker` is removed completely, use `@vitest/mocker` package directly (this was published by accident at one point and never removed)
+- `vitest/internal/module-runner` is removed
## Migrating from Jest {#jest}