Skip to content

docs: add warning for clearMocks option in async tests#9697

Merged
sheremet-va merged 8 commits intovitest-dev:mainfrom
sapphi-red:patch-1
Feb 20, 2026
Merged

docs: add warning for clearMocks option in async tests#9697
sheremet-va merged 8 commits intovitest-dev:mainfrom
sapphi-red:patch-1

Conversation

@sapphi-red
Copy link
Contributor

@sapphi-red sapphi-red commented Feb 19, 2026

Description

IIUC enabling this option causes problem with async concurrent tests.

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
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 28308f6
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/69983aaf27b87d00086408b1
😎 Deploy Preview https://deploy-preview-9697--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.

@sheremet-va
Copy link
Member

Well, this is true for its sister options too, like mockReset, restoreMocks, unstubEnvs and unstubGlobals

Maybe instead of do not use we can say be aware?

graphite-app bot pushed a commit to rolldown/rolldown that referenced this pull request Feb 19, 2026
I guess `mockReset: true` will break things: vitest-dev/vitest#9697
@sapphi-red
Copy link
Contributor Author

True; I've added to them as well.

@sheremet-va sheremet-va merged commit b7902bc into vitest-dev:main Feb 20, 2026
10 checks passed
@sapphi-red sapphi-red deleted the patch-1 branch February 24, 2026 07:01
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