vscode-jest icon indicating copy to clipboard operation
vscode-jest copied to clipboard

"Snapshot Missing" when test does not have parent

Open seanpoulter opened this issue 7 years ago • 4 comments
trafficstars

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

seanpoulter avatar Feb 01 '18 04:02 seanpoulter

I have the same problem

jvbianchi avatar Feb 14 '18 12:02 jvbianchi

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.

seanpoulter avatar Feb 14 '18 14:02 seanpoulter

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

vvo avatar Jun 27 '18 19:06 vvo

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.

github-actions[bot] avatar Apr 10 '25 03:04 github-actions[bot]