Skip to content

feat: interactive snapshot update - #9297

Closed
mzhubail wants to merge 8 commits into
vitest-dev:mainfrom
mzhubail:feature/interactive-snapshot-update
Closed

mzhubail wants to merge 8 commits into
vitest-dev:mainfrom
mzhubail:feature/interactive-snapshot-update

Conversation

@mzhubail

Copy link
Copy Markdown
Contributor

Description

This adds a cli option, that would go through failed snapshots and display them one by one, prompting user to validate output.

Resolves #2229

image

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify

netlify Bot commented Dec 18, 2025

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 395d2a7
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6943f4a2564864000870ce7a
😎 Deploy Preview https://deploy-preview-9297--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mzhubail

Copy link
Copy Markdown
Contributor Author

This is still an early PR. I would like to check two things before I proceed any further.

  1. For test running I've used project.createSpecification with ctx.rerunTestSpecifications to create test specs and run them. The obvious downside of this is that this would only work if we have includeTaskLocation: true in our config.

    I'm not sure how to move forward from this of if there's an API that's a better fit.

  2. When selecting snapshots, I clear screen between snapshots to separate snapshots if user ends up not selecting any snapshot (skips on all or quits q), I print out the onTestRunEnd to get the user to a view similar to that before the running the interactive snapshot update.

    However, the current implementation doesn't include suite / test summary and feels overall a bit too hacky. Any suggestions on how to handle this would be much welcomed.

    else {
    ctx.logger.clearFullScreen()
    // TODO: This is a hack to trigger report summary again
    ctx.report('onTestRunEnd', testModules, errors as SerializedError[], state)
    }

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Hello @mzhubail. Thank you for taking the time to contribute!

Unfortunately, the team accepts pull requests only from maintainers and approved contributors, so this pull request was closed automatically. We are sorry about that, it is not a judgement of your work. The number of pull requests grew beyond what the team can review, and this policy gives maintainers the space to triage and prioritize issues at their own pace.

Please keep the discussion in #2229. Your changes are not lost: a maintainer can reopen this pull request if the team decides to go forward with it. See our pull request policy for more context.

@github-actions github-actions Bot closed this Oct 5, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interactive snapshot update/create mode

1 participant