Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add filename for obsolete snapshot file #8665

Merged

Conversation

ndelangen
Copy link
Contributor

Summary

When a snapshot exists that's completely redundant because there's no test file that generates it, jest will report it found a obsolete snapshot:

Screenshot 2019-07-09 at 11 39 59

Especially on a CI this can be not particularity useful, as there is no information on what's actually gone wrong, and the user cannot run -u on CI.

Test plan

I have added e2e test called snapshot-unknown. This demonstrated the output or the cli reporter when there are 2 unknown snapshots. It should look like this:

Screenshot 2019-07-09 at 16 21 51

This addresses:
#5005 (comment)

@ndelangen

This comment has been minimized.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! Will need to figure out why CI fails, but the code LGTM

@SimenB

This comment has been minimized.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is happy now

Copy link
Contributor

@jeysal jeysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Test result property naming getting awkward but I guess we'll have to live with that as anything else is too breaking

packages/jest-core/src/TestScheduler.ts Outdated Show resolved Hide resolved
@jeysal jeysal merged commit f440ded into jestjs:master Jul 26, 2019
@ndelangen ndelangen deleted the ndelangen/add-filename-for-obsolete-snapshot-file branch July 28, 2019 19:12
@ndelangen
Copy link
Contributor Author

🎉

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants