vitest-dev / vitest-dev/vscode
Preview / go to snapshot
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 924
- Forks
- 122
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 6
Description
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:
- 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. - 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:
- Would it be possible to add these features to
Vitestextension? - Could they be optional, toggled in the settings?
- Should it rather be a separate extension?
Suggested solution
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Vitest VS Code extension and the referenced snapshot-tools PR to understand existing snapshot support. Verify how .toMatchSnapshot() and .toThrowErrorMatchingSnapshot() are handled, then determine whether hover previews and Ctrl-click navigation can be added with an optional setting. Done means both functions expose the asserted snapshot in the requested VS Code interactions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- testing, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100