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

When snapshots are written, include what suites/tests caused them to be written #4461

Closed
paularmstrong opened this issue Sep 11, 2017 · 4 comments

Comments

@paularmstrong
Copy link

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

When running tests in a CI environment, we will fail test runs that create new snapshots (that were either updated or not committed ahead of the CI run).

The output from Jest is something like:

Snapshot Summary
* 2 snapshots written in 1 test suite.
* 2 obsolete snapshots found, run with `npm test -- -u` to remove them.

What is the expected behavior?

Ideally, this would tell us both which suites and which tests caused those to be written. It would be much quicker to debug where the issue is instead of needing to run a thousand test suites with --updateSnapshots and wait for that to finish.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

  • Jest v20.0.4
@thymikee
Copy link
Collaborator

Isn't this working for you? It's already available since Jest v20. You can also try with --ci flag.

@thymikee
Copy link
Collaborator

See #3693

@paularmstrong
Copy link
Author

Had not seen this option. Thanks!

@github-actions
Copy link

This issue 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 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants