Skip to content

expect.soft doesnt work with toMatchSnapshot #8673

@tijmenvanegmond

Description

@tijmenvanegmond

Describe the bug

Expect.soft doesn't seem to be respected when using toMatchSnapshot, and instead of continuing the test it terminates on failed execution.

    expect.soft({foo:"bar"}).toMatchObject({foo:"baz"})
    // execution continues
 
    expect.soft({ time: new Date() }).toMatchSnapshot()
    // execution doesn't continue here

Reproduction

https://github.com/tijmenvanegmond/vitest-expect-soft-snapshota

System Info

System:
    OS: macOS 26.0.1
    CPU: (8) arm64 Apple M1
    Memory: 315.45 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0
    npm: 10.9.2
    pnpm: 10.0.0
  Browsers:
    Chrome: 141.0.7390.55
    Firefox: 143.0.4
    Safari: 26.0.1
  npmPackages:
    @vitest/ui: 3.2.4 => 3.2.4 
    vitest: 3.2.4 => 3.2.4

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)pr welcome

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions