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

Preview / go to snapshot #576

Open
4 tasks done
bakasmarius opened this issue Jan 21, 2025 · 1 comment
Open
4 tasks done

Preview / go to snapshot #576

bakasmarius opened this issue Jan 21, 2025 · 1 comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@bakasmarius
Copy link

Clear and concise description of the problem

Our team migrated from Jest to Vitest in our NestJS backend project and we were very happy until we realized we were using a few features from snapshot-tools extension so often that we even forgot it was a separate VSCode extension 😅 (we are using almost 500 x .toMatchSnapshot() to validate data in the test files, so previewing snapshots in the same window where the test code is, is a very nice development experience)

There is a PR in that repo that should enable those features with Vitest, but the repo seems to be abandoned and I couldn't make that PR work locally on my VSCode.

So those features simply are these:

  1. When hovering with the mouse over these functions: .toMatchSnapshot() and .toThrowErrorMatchingSnapshot() - we should see the actual snapshot that we are asserting inside the popup instead of info about these functions.
  2. When using CTRL + Left Mouse Click on .toMatchSnapshot() and .toThrowErrorMatchingSnapshot(), it should go to a snapshot itself inside the snapshot file instead of going to the function definition.

So my questions are:

  1. Would it be possible to add these features to Vitest extension?
  2. Could they be optional, toggled in the settings?
  3. Should it rather be a separate extension?

Suggested solution

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

If someone can contribute this, I am open to having it built-in 😄

@sheremet-va sheremet-va added p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement: pending triage labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

2 participants