Skip to content

fix(vitest): fix file snapshots in skipped suites considered obsolete#4795

Merged
sheremet-va merged 5 commits intovitest-dev:mainfrom
hi-ogawa:fix-skip-suite-snapshot
Dec 28, 2023
Merged

fix(vitest): fix file snapshots in skipped suites considered obsolete#4795
sheremet-va merged 5 commits intovitest-dev:mainfrom
hi-ogawa:fix-skip-suite-snapshot

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Dec 22, 2023

Description

Closes #2442
Supersedes and closes #4009

Current behavior was quite tricky, so I created (hopefully) cleaner repro here (and this is the base of the test I added in this PR):

The repro shows that treating snapshots as "obsolete" is not only about wrong warning, but also it has a consequence of deleting those skipped snapshots when running with -u.

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.

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:.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vitest warns about obsolete snapshots for from skipped tests

2 participants