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

Updating Snapshots After Commit in Watch Mode #6191

Closed
r-walsh opened this issue May 15, 2018 · 3 comments
Closed

Updating Snapshots After Commit in Watch Mode #6191

r-walsh opened this issue May 15, 2018 · 3 comments

Comments

@r-walsh
Copy link

r-walsh commented May 15, 2018

🐛 Bug Report

After committing changes without updating snapshots it is no longer possible to update those snapshots in watch mode.

It is an easy enough problem to work around by cancelling the watch and running jest -u, but I find I still bump into it every now and again.

To Reproduce

Steps to reproduce the behavior:

  1. Commit changes to a function that is tested via snapshot without updating the snapshots
  2. Run jest --watch and input a when prompted to run the full suite
  3. The tests will fail (as expected) on the out of date snapshot
  4. Input u to update snapshots
  5. Jest will log that no changes were found and not update any snapshots
No tests found related to files changed since last commit.
Press `a` to run all tests, or run Jest with `--watchAll`.

Watch Usage: Press w to show more.

Expected behavior

I expected Jest to update the failed snapshots from the previous run.

Link to repl or repo (highly encouraged)

https://github.com/r-walsh/jest-snapshot-update-bug
The above repo already has changes committed with out of date snapshots, so start at 2 in the reproduction steps.

Run npx envinfo --preset jest

  System:
    OS: macOS Sierra 10.12.6
    CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 8.9.4 - /usr/local/bin/node
    Yarn: 1.5.1 - /usr/local/bin/yarn
    npm: 6.0.0 - /usr/local/bin/npm
  npmPackages:
    jest: ^22.4.3 => 22.4.3
@SimenB
Copy link
Member

SimenB commented May 15, 2018

Pretty sure this is fixed in #5696. Mind installing jest@beta to verify?

@r-walsh
Copy link
Author

r-walsh commented May 15, 2018

@SimenB Yup! Just verified locally. Thanks for the quick response

@r-walsh r-walsh closed this as completed May 15, 2018
@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 12, 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