Skip to content

Commit b44bda8

Browse files
authored
test: ensure that Node process does not output color (#1779)
1 parent ce4b76d commit b44bda8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rules/utils/__tests__/detectJestVersion.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ const runNodeScript = (cwd: string, script: string) => {
2121
const { stdout, stderr } = spawnSync(
2222
'node',
2323
['-p', script.split('\n').join(' ')],
24-
{ cwd, encoding: 'utf-8' },
24+
{
25+
cwd,
26+
encoding: 'utf-8',
27+
env: { ...process.env, FORCE_COLOR: '0', NO_COLOR: '1' },
28+
},
2529
);
2630

2731
return { stdout: stdout.trim(), stderr: stderr.trim() };

0 commit comments

Comments
 (0)