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

show file path for obsolete snapshots #23

Merged
merged 2 commits into from
Dec 1, 2020

Conversation

ron23
Copy link
Contributor

@ron23 ron23 commented Nov 20, 2020

If a test fail due to obsolete snapshot, it's impossible to tell which file has the snapshots.
The filePath flag only address an actual test failure (via asserting testResult.failureMessage).
This PR adds support to show filePath for obsolete snapshots as well.
This tries to solve the same problem reported here #15 but instead of showing the report, simply show the file path for where the error occurred.

The result

$ yarn test:ci 
yarn run v1.21.1
$ JEST_SILENT_REPORTER_SHOW_WARNINGS=true JEST_SILENT_REPORTER_SHOW_PATHS=true <some path> --ci --silent --reporters=jest-silent-reporter --reporters=jest-junit

<the file path with the error>
 › 1 obsolete snapshot found.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is the same as #19 but created again against the new main branch

Copy link
Owner

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

Works for me!

@rickhanlonii rickhanlonii merged commit d8ace35 into rickhanlonii:BLACK-LIVES-MATTER Dec 1, 2020
@rickhanlonii
Copy link
Owner

Published as 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants