Packages

@vitest/expect

5.0.5 · 15 Oct 2026MIT151.9M / weekRepositoryHomepagenpmAtom feed

Your version

0.34.0

1 Aug 2023Where it was published

0.34.7 is the newest release of 0.34.x.

In short

7 breaking1 deprecated3 new17 fixed1 changed

  • breaking

    Transform mode affects only test files, not regular files

  • breaking

    Custom environment now should be processed before Vitest can consume it. It means that you cannot specify a path to a TS file or use import paths that should be processed by Vite.

  • breaking

    Disable coverage.reportOnFailure by default

  • breaking

    Remove @vitest/coverage-c8 package

  • breaking

    Support running tests using VM context

  • breaking

    vite-node: Make CLI arguments parsing behavior consistent with node/tsx/ts-node

  • breaking

    Add preact example, remove optimizer experimental status, enable by default

  • deprecated

    Deprecate deps.registerNodeLoader

Release note

Breaking Changes

  • breaking

    Transform mode affects only test files, not regular files

    • transformMode is now moved to server.transformMode. This option is highly discouraged to use. If you need to change the transform mode, use the new option testTransformMode instead to control the mode based on the running test, not the current file path. By default, tests with jsdom or happy-dom use web transform mode, and tests using node or edge environment use ssr mode. If you have a custom environment, it should provide transformMode property.

  • breaking

    Custom environment now should be processed before Vitest can consume it. It means that you cannot specify a path to a TS file or use import paths that should be processed by Vite.

  • breaking

    Disable coverage.reportOnFailure by default

  • breaking

    Remove @vitest/coverage-c8 package

  • breaking

    Support running tests using VM context

    • To address speed issues in some applications, Vitest now provides experimentalVmThreads pool to run your tests using VM Sandboxes environment. Make sure you understand all pitfalls of this pool before opening an issue.

  • breaking

    Introduce server option

    • Most of deps. options are now moved to server.deps with a deprecation warning. Please, consider using deps.optimizer instead of deps.inline/deps.external. Ideally, we would like to move away from using server.deps.inline altogether.

  • breaking

    vite-node: Make CLI arguments parsing behavior consistent with node/tsx/ts-node

    • You now have to provide CLI arguments before the entry point. For example, instead of vite-node index.ts --watch, you now have to do vite-node --watch index.ts.

  • breaking

    Add preact example, remove optimizer experimental status, enable by default

    • deps.optimizer is now enabled by default. This means that Vitest will bundle specified dependencies before running your tests. This field inherits options from optimizeDeps and ssr.optimizeDeps which are populated by other plugins (like, Svelte).

Features

  • Support describe.sequential

  • Support config junit reporter className with env

  • Running vitest with --related --watch reruns non-affected tests if they were changed during a run

Bug Fixes

  • Isolate workers between envs and workspaces

  • Modify condition

  • Module Graph view is blocking the Console view

  • Port the latest defineConfig type from vite

  • Don't overwrite Node.js URL global

  • ForceRerunTriggers correctly triggers a rerun

  • browser: Don't inline magic-string and estree-walker

  • browser: Multi-suite coverage

  • core: DataView comparison does not work in toStrictEqual

  • coverage: V8 provider to pick source maps without url query params

  • coverage: Update istanbul-lib-instrument to v6 to fix vulnerable dependency

  • coverage: Exclude vite virtual modules by default

  • node: Guard error info

  • vite-node: Always treat node_modules as modulesDirectory

  • vite-node: Normalize drive letter to keep the same reference to a module

  • vite-node: Correctly resolve hmr filepath

  • watch: Clear screen on all terminals

Performance

  • deprecated

    Deprecate deps.registerNodeLoader

    • This option was introduced to support aliasing inside external packages. Please, use deps.optimizer.web instead. If you test Node.js applications, consider adding external packages to server.deps.inline.