From 9534c90ecd245a224c998033c03eb0f8e13d5fc7 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Mon, 23 Jun 2025 07:19:20 +1200 Subject: [PATCH] test: ensure that Node process does not output color --- src/rules/utils/__tests__/detectJestVersion.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rules/utils/__tests__/detectJestVersion.test.ts b/src/rules/utils/__tests__/detectJestVersion.test.ts index 2ab7f7923..68fa16545 100644 --- a/src/rules/utils/__tests__/detectJestVersion.test.ts +++ b/src/rules/utils/__tests__/detectJestVersion.test.ts @@ -21,7 +21,11 @@ const runNodeScript = (cwd: string, script: string) => { const { stdout, stderr } = spawnSync( 'node', ['-p', script.split('\n').join(' ')], - { cwd, encoding: 'utf-8' }, + { + cwd, + encoding: 'utf-8', + env: { ...process.env, FORCE_COLOR: '0', NO_COLOR: '1' }, + }, ); return { stdout: stdout.trim(), stderr: stderr.trim() };