From 2c313084a827e5889061756e16827a2f8cccdc9a Mon Sep 17 00:00:00 2001 From: nntrivi2001 Date: Tue, 4 Aug 2026 09:04:59 +0700 Subject: [PATCH] fix(test): stop FORCE_COLOR/CCAM_COLOR leaking into spawned ccam CLI children The sandbox's ambient FORCE_COLOR=3 was inherited by every ccam-cli.test.js child process spawn, defeating the CLI's own "colors off when piped" default and breaking every plain-text output assertion (help text, piped output, offline-mode rendering). --- server/__tests__/ccam-cli.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/__tests__/ccam-cli.test.js b/server/__tests__/ccam-cli.test.js index 351c7ec..0ad04a4 100644 --- a/server/__tests__/ccam-cli.test.js +++ b/server/__tests__/ccam-cli.test.js @@ -29,6 +29,12 @@ process.env.DASHBOARD_DB_PATH = path.join(TMP, "dashboard.db"); process.env.CLAUDE_HOME = path.join(TMP, "home"); process.env.DASHBOARD_DATA_DIR = path.join(TMP, "data"); process.env.DASHBOARD_LIVENESS_PROBE = "0"; +// Every spawn below inherits `process.env` — a shell that forces color +// (FORCE_COLOR/CCAM_COLOR set in the environment running this test) would +// leak into the spawned CLI child and defeat its own "colors off when piped" +// behavior, which every plain-text assertion in this file assumes. +delete process.env.FORCE_COLOR; +delete process.env.CCAM_COLOR; const { createApp, startServer } = require("../index"); const { db } = require("../db");