You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jest does not automatically write new snapshots in watch mode if a previous snapshot has been updated in the current watch session, even if that snapshot is for another test suite. Instead, it prints the following message:
New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.
This applies in --watch and --watchAll modes.
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.
Cause one of the snapshot tests in src/Person.test.js to fail
Press u to update the snapshot
Uncomment the last test and note the message as above
What is the expected behavior?
Jest writes a snapshot for the new test.
Note that if you quit instead of forcing it to write the new snapshot with u, the snapshot will be written the next time you run Jest. Also, if you uncomment the test before updating any snapshots then the snapshot is written as expected.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Tried on two different systems.
OS: Windows 8.1 x64
Node: 8.9.1
npm: 5.5.1
yarn: 1.3.2
Jest: 21.2.1
Shell: Tried both Windows Command Prompt and Git Bash (which I believe uses Mintty as a terminal emulator)
OS: Windows 7 x64
Node: 6.11.2
npm: 3.10.10
Jest: 21.2.1
Shell: Both Windows Command Prompt and Git Bash
The text was updated successfully, but these errors were encountered:
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.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Jest does not automatically write new snapshots in watch mode if a previous snapshot has been updated in the current watch session, even if that snapshot is for another test suite. Instead, it prints the following message:
This applies in
--watch
and--watchAll
modes.If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.Repro available here: https://github.com/gsteacy/jest-bug-repro
src/Person.test.js
to failu
to update the snapshotWhat is the expected behavior?
Jest writes a snapshot for the new test.
Note that if you quit instead of forcing it to write the new snapshot with
u
, the snapshot will be written the next time you run Jest. Also, if you uncomment the test before updating any snapshots then the snapshot is written as expected.Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Tried on two different systems.
OS: Windows 8.1 x64
Node: 8.9.1
npm: 5.5.1
yarn: 1.3.2
Jest: 21.2.1
Shell: Tried both Windows Command Prompt and Git Bash (which I believe uses Mintty as a terminal emulator)
OS: Windows 7 x64
Node: 6.11.2
npm: 3.10.10
Jest: 21.2.1
Shell: Both Windows Command Prompt and Git Bash
The text was updated successfully, but these errors were encountered: