Skip to content

Preview / go to snapshot #576

Open
Open
@bakasmarius

Description

@bakasmarius

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-nice-to-haveNot breaking anything but nice to have (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions