Compared with 4.0.18: `TestAPI.scoped`, `it.scoped`, `Assertion.toBeCalledTimes`, `Assertion.toBeCalled`, `Assertion.toBeCalledWith`, and 294 more. 70 newly deprecated.
vitest 4.0.18 → 5.0.5: deprecates 299 API(s): from its source to your code
Assertion.toBeCalledTimes: Ensures that a mock function is called an exact number of times. Alias for `expect.toHaveBeenCalledTimes`. Use `toHaveBeenCalledTimes` instead
Assertion.toBeCalled: Ensures that a mock function is called. Alias for `expect.toHaveBeenCalled`. Use `toHaveBeenCalled` instead
Assertion.toBeCalledWith: Ensure that a mock function is called with specific arguments. Alias for `expect.toHaveBeenCalledWith`. Use `toHaveBeenCalledWith` instead
Assertion.toThrowError: Used to test that a function throws when it is called. Alias for `expect.toThrow`. Use `toThrow` instead
Assertion.toReturn: Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time Alias for `expect.toHaveReturned`. Use `toHaveReturned` instead
Assertion.toReturnTimes: Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times. Any calls to the mock function that throw an error are not counted toward the number of times the function returned. Alias for `expect.toHaveReturnedTimes`. Use `toHaveReturnedTimes` instead
Assertion.toReturnWith: Use to ensure that a mock function returned a specific value. Alias for `expect.toHaveReturnedWith`. Use `toHaveReturnedWith` instead
JestAssertion.toBeCalledTimes: Ensures that a mock function is called an exact number of times. Alias for `expect.toHaveBeenCalledTimes`. Use `toHaveBeenCalledTimes` instead
JestAssertion.toBeCalled: Ensures that a mock function is called. Alias for `expect.toHaveBeenCalled`. Use `toHaveBeenCalled` instead
JestAssertion.toBeCalledWith: Ensure that a mock function is called with specific arguments. Alias for `expect.toHaveBeenCalledWith`. Use `toHaveBeenCalledWith` instead
JestAssertion.toThrowError: Used to test that a function throws when it is called. Alias for `expect.toThrow`. Use `toThrow` instead
JestAssertion.toReturn: Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time Alias for `expect.toHaveReturned`. Use `toHaveReturned` instead
JestAssertion.toReturnTimes: Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times. Any calls to the mock function that throw an error are not counted toward the number of times the function returned. Alias for `expect.toHaveReturnedTimes`. Use `toHaveReturnedTimes` instead
JestAssertion.toReturnWith: Use to ensure that a mock function returned a specific value. Alias for `expect.toHaveReturnedWith`. Use `toHaveReturnedWith` instead
WebSocketHandlers.getResolvedProjectLabels: Use `getConfig().projects` instead.
SuiteCollector.test.scoped: Use `test.override()` instead
WorkerGlobalState.environment.transformMode: use `viteEnvironment` instead. Uses `name` by default
Assertion.resolves.toBeCalledTimes: Ensures that a mock function is called an exact number of times. Alias for `expect.toHaveBeenCalledTimes`. Use `toHaveBeenCalledTimes` instead
Assertion.resolves.toBeCalled: Ensures that a mock function is called. Alias for `expect.toHaveBeenCalled`. Use `toHaveBeenCalled` instead
Assertion.resolves.toBeCalledWith: Ensure that a mock function is called with specific arguments. Alias for `expect.toHaveBeenCalledWith`. Use `toHaveBeenCalledWith` instead
Assertion.resolves.toThrowError: Used to test that a function throws when it is called. Alias for `expect.toThrow`. Use `toThrow` instead
Assertion.resolves.toReturn: Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time Alias for `expect.toHaveReturned`. Use `toHaveReturned` instead
Assertion.resolves.toReturnTimes: Use to ensure that a mock function returned successfully (i.e., did not throw an error) an exact number of times. Any calls to the mock function that throw an error are not counted toward the number of times the function returned. Alias for `expect.toHaveReturnedTimes`. Use `toHaveReturnedTimes` instead
Assertion.resolves.toReturnWith: Use to ensure that a mock function returned a specific value. Alias for `expect.toHaveReturnedWith`. Use `toHaveReturnedWith` instead
node:parseAst: - use `parseSync` instead
node:parseAstAsync: - use `parse` instead
node:BaseCoverageOptions: Use `CoverageOptions` instead
node:CoverageIstanbulOptions: Use `CoverageOptions` instead
node:CoverageV8Options: Use `CoverageOptions` instead
node:CustomProviderOptions: Use `CoverageOptions` instead
node:createVitest: The `mode` argument is no longer used. Use `createVitest(options, viteOverrides?, vitestOptions?)` instead.
node:isFileServingAllowed: Check if the url is allowed to be served, via the `server.fs` config. Use the `isFileLoadingAllowed` function instead.
node:startVitest: Start Vitest programmatically Returns a Vitest instance if initialized successfully. The `mode` argument is no longer used. Use `startVitest(cliFilters?, options?, viteOverrides?, vitestOptions?)` instead.
config:Plugin.resolveDynamicImport: Defines a custom resolver for dynamic imports. This hook exists only for Rollup compatibility. Please use {@linkcode resolveId} instead.
config:Plugin.shouldTransformCachedModule: This hook is not supported by Rolldown yet. But the type is declared for compatibility. This hook is **not** deprecated. It is marked as deprecated just to make it clear that this hook is currently a no-op.
config:ViteUserConfig.esbuild: Transform options to pass to esbuild. Or set to `false` to disable esbuild. Use `oxc` option instead.
config:TestProjectInlineConfiguration.esbuild: Transform options to pass to esbuild. Or set to `false` to disable esbuild. Use `oxc` option instead.
config:UserWorkspaceConfig.esbuild: Transform options to pass to esbuild. Or set to `false` to disable esbuild. Use `oxc` option instead.
node:Vite.HMRPayload: use HotPayload
node:Vite.isFileServingAllowed: Check if the url is allowed to be served, via the `server.fs` config. Use the `isFileLoadingAllowed` function instead.
node:Vite.optimizeDeps: Scan and optimize dependencies within a project. Used by Vite CLI when running `vite optimize`. the optimization process runs automatically and does not need to be called
node:DepsOptimizationOptions.esbuildOptions: Options to pass to esbuild during the dep scanning and optimization Certain options are omitted since changing them would not be compatible with Vite's dep optimization. - `external` is also omitted, use Vite's `optimizeDeps.exclude` option - `plugins` are merged with Vite's dep plugin https://esbuild.github.io/api Use `rolldownOptions` instead.
node:VitestPluginContext.experimental_defineCacheKeyGenerator: Use {@link defineCacheKeyGenerator} instead.
node:Vitest.mode: Do not rely on this property, it's always `test`. Scheduled to be removed in the next major.
node:Vitest.experimental_clearCache: Use `clearCache` instead.
node:Vitest.init: use `standalone()` instead
node:Vitest.experimental_parseSpecifications: Use `parseSpecifications` instead
config:ViteUserConfig.worker.rollupOptions: Alias to `rolldownOptions`. Use `rolldownOptions` instead.