Skip to content

Explain which snapshots are obsolete #5005

@crubier

Description

@crubier

When jest finds obsolete snapshots, it does not explain which one they are. This can be very frustrating, when you have many snapshots and you can't find which one is wrong...

The problem was also shortly discussed in #3581

Jest output:

 › 2 obsolete snapshots found.
Snapshot Summary
 › 2 obsolete snapshots found, run with `npm run prod-test -- -u` to remove them.

Test Suites: 5 passed, 5 total
Tests:       211 passed, 211 total
Snapshots:   190 passed, 190 total
Time:        13.694s
Ran all test suites.

I expect an output more like:

 › 2 obsolete snapshots found:
   - ThisComponent
   - ThisOtherComponent

Snapshot Summary
 › 2 obsolete snapshots found, run with `npm run prod-test -- -u` to remove them.

Test Suites: 5 passed, 5 total
Tests:       211 passed, 211 total
Snapshots:   190 passed, 190 total
Time:        13.694s
Ran all test suites.

This is a problem for me because when I run tests locally, no snapshot are obsolete, but when run in my CI/CD, it finds 2 obsolete snapshots, without telling me which ones....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions