Packages

@vitest/snapshot

5.1.0 · 2 Nov 2026MIT134.2M / weekRepositoryHomepagenpmAtom feed

Your version

0.32.0

6 Jun 2023Where it was published

0.34.7 is the newest release of 0.32.x.

In short

3 breaking2 new1 fixed

  • Breaking

    Throw an error, if the module cannot be resolved

  • Breaking

    Improve globs

  • Breaking

Release note

The section about @vitest/snapshot of a note shared by several packages.

Breaking Changes

  • Breaking

    Throw an error, if the module cannot be resolved

    • Vitest used to fall back to the original import when it could not resolve it to the file path or the virtual module. This leads to hard-to-find module graph mismatches if you had incorrect alias or relied on relative imports to be resolved to the project root (which is usual behavior in TypeScript) because the code accidentally "worked". With this release, Vitest will now throw an error if it cannot resolve the module - there are possible edge cases that are not covered yet, so if you have any problems with this, please open a separate issue with reproduction.

  • Breaking

    Improve globs

    • Vitest now has glob patterns similar to Jest for better compatibility. It's possible that some files will be considered test files when previously they were not. For example, Vitest now considers test.js to be a test file. Also any file in __tests__ is now considered to be a test, not just files with test or spec suffix.

  • Breaking

    Add @vitest/coverage-v8 package

    • Vitest now uses v8 code coverage directly for better performance. @vitest/coverage-c8 is deprecated as Vitest no longer uses c8 package for coverage output. It will not be updated anymore, and Vitest will fail in the next version if the user has c8 as their coverage provider. Please, install the new @vitest/coverage-v8 package if you previously used @vitest/coverage-c8.

Features

  • Support ssr optimizer

  • Image type add apng

Bug Fixes

  • The cli option is passed to coverage.exclude

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.