Skip to content

fix: Preserve test results from previous runs#8043

Merged
sheremet-va merged 1 commit intovitest-dev:mainfrom
macko911:preserve-cache-results-from-previous-run
May 28, 2025
Merged

fix: Preserve test results from previous runs#8043
sheremet-va merged 1 commit intovitest-dev:mainfrom
macko911:preserve-cache-results-from-previous-run

Conversation

@macko911
Copy link
Copy Markdown
Contributor

Description

I want to preserve test results stored in node_modules/.vite/results.json so that they are not overwritten on subsequent runs of vitest, e.g. if I run vitest twice like this

pnpm vitest first.test
pnpm vitest second.test

I want results of both test runs to be recorded. Currently only results of the second.test are stored in the results.json file.

Not sure if the current behavior is desired but it looks to me like the if statement just didn't consider major versions at the time.

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

@macko911 macko911 changed the title fix: Preserve cache results from previous runs fix: Preserve test results from previous runs May 28, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented May 28, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e8a1fb5
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/683709eed6936e00087c816b
😎 Deploy Preview https://deploy-preview-8043--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.

Copy link
Copy Markdown
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about any of these, but it does seem like there was a bug previously, so let's merge it and see

@sheremet-va sheremet-va merged commit d6ef0da into vitest-dev:main May 28, 2025
13 checks passed
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.

2 participants