'Would you like to update your Snapshots?' will not be shown in case of parameterized tests (describe.each)describe.each
See original GitHub issueEnvironment
node -v
: v8.16.0npm -v
: v6.4.1npm ls jest
: jest@24.8.0- your vscode-jest settings if customized:
- “jest.rootPath”: “./toolkit”,
- “jest.restartJestOnSnapshotUpdate”: true,
** Expected Behaviour ** I use describe.each in my tests and I expect that the “Would you like to update your Snapshots?” dialog will be shown if the snapshot tests fail.
** Actual Behaviour ** The dialog will not be shown because it checks only for “snapshot failed” and “snapshot test failed”
Is the following check on purpose or can it be extended so that parameterized checks also work?
Jest Output in case of describe.each
DummyTests > paramTest > Value "red"
expect(received).toMatchSnapshot()
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.
Received value "green"
....
at Object.toMatchSnapshot (node_modules/jest-chain/dist/chain.js:15:11)
at Object.test (tests/effects/fillEffect.test.ts:44:66)
› 3 snapshots failed.
Snapshot Summary
› 3 snapshots failed from 1 test suite. Inspect your code changes or press 'u' to update them.
Test Suites: 1 failed, 1 total
Tests: 3 failed, 3 total
Snapshots: 3 failed, 3 total
Time: 3.619s
Ran all test suites related to changed files.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Jest: How to Update Snapshot Tests - In Plain English
Run the snapshot test, make sure it passes — if it does not pass, find the problem and fix it, don't change the...
Read more >Snapshot Testing - Jest
Snapshot tests are a very useful tool whenever you want to make sure your UI does not change unexpectedly.
Read more >Parameterized tests - Product Documentation | ServiceNow
Produces a separate test result for each data set. When the test runs, Automated Test Framework replaces the parameters with data set values....
Read more >JUnit 5 User Guide
Such annotations are inherited at the class level but not at the method ... That means that you can define your own composed...
Read more >Be Smart, Write Parameterized Tests with Jest!
Have you ever feel like that extra it or test block you've just added inside your describe test block, looks exactly like the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done: https://github.com/jest-community/vscode-jest/issues/478
@connectdotz , I adopted the Jest ‘Getting-Started’ example and added it to my bugreports repo: https://github.com/shruda/bugreports/tree/master/vscode-jest/474