vscode-jest
vscode-jest copied to clipboard
"Snapshot Missing" when test does not have parent
Steps to Reproduce
Save the snapshot for:
it('', () => expect('test').toMatchSnapshot())
and reload the window. You'll see the "snapshot missing" message.
Snapshot in jest-editor-support will build the snapshot name adding the test prefix for tests without a parent. This changed in facebook/jest#2857 but has not been fixed.
Expected Behavior
Snapshot is found.
Actual Behavior
Snapshot CodeLens shows "snapshot missing"
Suggested Changes
- [ ] Integration test in Jest
- [ ] Fix
jest-editor-support - [ ] Integration test in this repo
I have the same problem
Anyone have time to look at a PR for jest-editor-support? I don't have the bandwidth right now but am happy to review.
As a temporary workaround for others junmping on here, just provide a wrapper like this:
describe('tests', () => {
i('works', () => {});
});
Right now root "it" will fail at showing snapshots with the extension
This issue has been inactive for over a year and has been marked as stale. It will be automatically closed in 30 days if no further activity occurs. Since significant changes have occurred in the codebase, please open a new issue with updated details if the problem still persists.