From 1c1040e219c4cd3a4dce72c36883899e2da6e759 Mon Sep 17 00:00:00 2001 From: dotta Date: Thu, 2 Apr 2026 10:43:44 -0500 Subject: [PATCH] test: make cli telemetry test deterministic in CI Co-Authored-By: Paperclip --- cli/src/__tests__/telemetry.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/src/__tests__/telemetry.test.ts b/cli/src/__tests__/telemetry.test.ts index 705ad949..9d42a609 100644 --- a/cli/src/__tests__/telemetry.test.ts +++ b/cli/src/__tests__/telemetry.test.ts @@ -4,6 +4,7 @@ import path from "node:path"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; const ORIGINAL_ENV = { ...process.env }; +const CI_ENV_VARS = ["CI", "CONTINUOUS_INTEGRATION", "BUILD_NUMBER", "GITHUB_ACTIONS", "GITLAB_CI"]; function makeConfigPath(root: string, enabled: boolean): string { const configPath = path.join(root, ".paperclip", "config.json"); @@ -70,6 +71,9 @@ function makeConfigPath(root: string, enabled: boolean): string { describe("cli telemetry", () => { beforeEach(() => { process.env = { ...ORIGINAL_ENV }; + for (const key of CI_ENV_VARS) { + delete process.env[key]; + } vi.stubGlobal("fetch", vi.fn(async () => ({ ok: true }))); });