Skip to content

add filename for obsolete snapshot file#8665

Merged
jeysal merged 13 commits intojestjs:masterfrom
ndelangen:ndelangen/add-filename-for-obsolete-snapshot-file
Jul 26, 2019
Merged

add filename for obsolete snapshot file#8665
jeysal merged 13 commits intojestjs:masterfrom
ndelangen:ndelangen/add-filename-for-obsolete-snapshot-file

Conversation

@ndelangen
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread packages/jest-snapshot/src/index.ts Outdated
Comment thread packages/jest-snapshot/src/index.ts
Comment thread packages/jest-snapshot/src/index.ts Outdated
Comment thread packages/jest-snapshot/src/index.ts Outdated
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@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

Comment thread packages/jest-core/src/TestScheduler.ts Outdated
@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
Copy Markdown
Contributor Author

🎉

@github-actions
Copy link
Copy Markdown

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