✅(vitest) Strip AI env vars in child processes#6865
Conversation
When tests run inside an AI agent environment, vitest may pick up agent env vars and use AgentReporter instead of its default reporter, which strips the verbose test result markers that test assertions rely on. This causes spurious test failures. Co-authored-by: Nicolas DUBIEN <[email protected]>
|
Co-authored-by: Nicolas DUBIEN <[email protected]>
@fast-check/ava
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6865 +/- ##
=======================================
Coverage 94.86% 94.86%
=======================================
Files 209 209
Lines 5665 5665
Branches 1489 1488 -1
=======================================
Hits 5374 5374
Misses 283 283
Partials 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Strip AI agent environment variables (CLAUDE_CODE, CURSOR_AGENT, etc.) from the environment passed to vitest child processes in tests.
When tests run inside an AI agent environment, vitest may pick up these env vars and use AgentReporter instead of its default reporter, which strips the verbose test result markers (
✓) that the test assertions rely on. This causes spurious test failures.Extracted from #6863. Mirrors the Jest equivalent in #6864.
Checklist
— Don't delete this checklist and make sure you do the following before opening the PR
pnpm run bumpor by following the instructions from the changeset bot🐛(vitest) Something...) when the change targets a package other thanfast-check