···237237- `environmentMatchGlobs` config option. Use [`projects`](/guide/projects) instead.
238238- Reporter APIs `onCollected`, `onSpecsCollected`, `onPathsCollected`, `onTaskUpdate` and `onFinished`. See [`Reporters API`](/advanced/api/reporters) for new alternatives. These APIs were introduced in Vitest `v3.0.0`.
239239- `deps.external`, `deps.inline`, `deps.fallbackCJS` config options. Use `server.deps.external`, `server.deps.inline`, or `server.deps.fallbackCJS` instead.
240240+- `browser.testerScripts` config option. Use [`browser.testerHtmlPath`](/guide/browser/config#browser-testerhtmlpath) instead.
240241241242This 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)).
242243
···295295}
296296```
297297298298-## browser.testerScripts
299299-300300-- **Type:** `BrowserScript[]`
301301-- **Default:** `[]`
302302-303303-::: danger DEPRECATED
304304-This API is deprecated an will be removed in Vitest 4. Please, use [`browser.testerHtmlPath`](#browser-testerhtmlpath) field instead.
305305-:::
306306-307307-Custom scripts that should be injected into the tester HTML before the tests environment is initiated. This is useful to inject polyfills required for Vitest browser implementation. It is recommended to use [`setupFiles`](#setupfiles) in almost all cases instead of this.
308308-309309-The script `src` and `content` will be processed by Vite plugins.
310310-311298## browser.commands
312299313300- **Type:** `Record<string, BrowserCommand>`
···11-import type { Vitest, WorkspaceProject } from 'vitest/node'
22-import type { WorkspaceSpec as DeprecatedWorkspaceSpec } from '../../../packages/vitest/src/node/pool'
11+import type { TestProject, Vitest } from 'vitest/node'
32import { describe, expect, test, vi } from 'vitest'
43import { BaseSequencer } from '../../../packages/vitest/src/node/sequencers/BaseSequencer'
54import { RandomSequencer } from '../../../packages/vitest/src/node/sequencers/RandomSequencer'
···2423 config: {
2524 root: import.meta.dirname,
2625 },
2727- } as any as WorkspaceProject
2626+ } as any as TestProject
2827}
29283029const workspace = buildWorkspace()
31303231function workspaced(files: string[]) {
3333- return files.map(file => new TestSpecification(workspace, file, 'forks')) as DeprecatedWorkspaceSpec[]
3232+ return files.map(file => new TestSpecification(workspace, file, 'forks'))
3433}
35343635describe('base sequencer', () => {
+2-3
test/reporters/src/context.ts
···2121 getModuleById: () => undefined,
2222 }
23232424- const server: Partial<ViteDevServer> = {
2424+ const vite: Partial<ViteDevServer> = {
2525 moduleGraph: moduleGraph as ModuleGraph,
2626 }
2727···3232 const context: Partial<Vitest> = {
3333 state: state as StateManager,
3434 config: config as ResolvedConfig,
3535- server: server as ViteDevServer,
3636- getProjectByTaskId: () => ({ getBrowserSourceMapModuleById: () => undefined }) as any,
3535+ vite: vite as ViteDevServer,
3736 getProjectByName: () => ({ getBrowserSourceMapModuleById: () => undefined }) as any,
3837 snapshot: {
3938 summary: { added: 100, _test: true },
···23232424export class ParentBrowserProject {
2525 public orchestratorScripts: string | undefined
2626- public testerScripts: HtmlTagDescriptor[] | undefined
27262827 public faviconUrl: string
2928 public prefixOrchestratorUrl: string
···22import type { Suite, Task, Test } from '../types/tasks'
33import { toArray } from '@vitest/utils'
4455-/**
66- * @deprecated use `isTestCase` instead
77- */
88-export function isAtomTest(s: Task): s is Test {
99- return isTestCase(s)
1010-}
1111-125export function isTestCase(s: Task): s is Test {
136 return s.type === 'test'
147}
+1-1
packages/vitest/src/api/setup.ts
···29293030 const clients = new Map<WebSocket, WebSocketRPC>()
31313232- const server = _server || ctx.server
3232+ const server = _server || ctx.vite
33333434 server.httpServer?.on('upgrade', (request: IncomingMessage, socket, head) => {
3535 if (!request.url) {
···2121export { VitestPlugin } from '../node/plugins'
2222export { resolveConfig } from '../node/plugins/publicConfig'
2323export { resolveFsAllow } from '../node/plugins/utils'
2424-export type { ProcessPool, WorkspaceSpec } from '../node/pool'
2424+export type { ProcessPool } from '../node/pool'
2525export { getFilePoolName } from '../node/pool'
2626export { createMethodsRPC } from '../node/pools/rpc'
2727export type { SerializedTestProject, TestProject } from '../node/project'
2828-export type { WorkspaceProject } from '../node/project'
2928export type { HTMLOptions } from '../node/reporters/html'
3029export type { JsonOptions } from '../node/reporters/json'
3130
···1111 if (id === 'vitest' || id.startsWith('@vitest/') || id.startsWith('vitest/')) {
1212 // always redirect the request to the root vitest plugin since
1313 // it will be the one used to run Vitest
1414- const resolved = await ctx.server.pluginContainer.resolveId(id, undefined, {
1414+ const resolved = await ctx.vite.pluginContainer.resolveId(id, undefined, {
1515 skip: new Set([plugin]),
1616 ssr,
1717 })
···207207 screenshotFailures?: boolean
208208209209 /**
210210- * Scripts injected into the tester iframe.
211211- * @deprecated Will be removed in the future, use `testerHtmlPath` instead.
212212- */
213213- testerScripts?: BrowserScript[]
214214- /**
215210 * Path to the index.html file that will be used to run tests.
216211 */
217212 testerHtmlPath?: string