Skip to content

Calling context.skip will skip all test fixture cleanups #7768

@Mange

Description

@Mange

Describe the bug

When using custom test fixtures and the context.skip helper in a test, the cleanup of fixtures are never handled.

Reproduction

https://github.com/Mange/vitest-skip-context-repro

  1. Clone repo.
  2. npm i
  3. npm test
  4. You will see a test failure, but all tests should pass (with 2 skips).

System Info

System:
    OS: Linux 6.11 cpe:/o:nixos:nixos:25.05 25.05 (Warbler)
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 49.09 GB / 62.71 GB
    Container: Yes
    Shell: 5.9 - /run/current-system/sw/bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nix-profile/bin/node
    npm: 10.9.2 - ~/.nix-profile/bin/npm
  Browsers:
  npmPackages:
    vite: latest => 6.2.4
    vitest: latest => 3.0.9

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

Labels

p4-importantViolate documented behavior or significantly improves performance (priority)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions