diff --git a/vitest.config.ts b/vitest.config.ts index bd474d7b7..c2d9435ad 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -25,6 +25,16 @@ export default defineConfig({ globals: true, environment: 'node', globalSetup: './vitest.setup.ts', + // Opt the suite out of telemetry. Many tests spawn the real CLI, which runs + // the preAction hook like any user invocation: it would persist an + // anonymousId into the developer's *real* global config and POST a + // command_executed event per spawn. Workers inherit this env, and so do the + // CLI child processes they spawn. Telemetry's own tests delete these vars + // before asserting, so they are unaffected. + env: { + OPENSPEC_TELEMETRY: '0', + DO_NOT_TRACK: '1', + }, // Tests rely on per-file process isolation (e.g., `process.cwd()` assumptions). pool: 'forks', maxWorkers: resolveMaxWorkers(),