From f64c3ed0cb67135d22f56570212ebbeaeeb6e2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Tue, 17 Dec 2024 10:21:15 +0200 Subject: [PATCH] fix: colors on forks pool --- packages/vitest/src/node/pool.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/vitest/src/node/pool.ts b/packages/vitest/src/node/pool.ts index 7cb70a5c3317..620596a56db6 100644 --- a/packages/vitest/src/node/pool.ts +++ b/packages/vitest/src/node/pool.ts @@ -3,6 +3,7 @@ import type { Vitest } from './core' import type { TestProject } from './project' import type { TestSpecification } from './spec' import type { BuiltinPool, Pool } from './types/pool-options' +import { isatty } from 'node:tty' import mm from 'micromatch' import { isWindows } from '../utils/env' import { createForksPool } from './pools/forks' @@ -124,6 +125,7 @@ export function createPool(ctx: Vitest): ProcessPool { VITEST: 'true', NODE_ENV: process.env.NODE_ENV || 'test', VITEST_MODE: ctx.config.watch ? 'WATCH' : 'RUN', + FORCE_TTY: isatty(1) ? 'true' : '', ...process.env, ...ctx.config.env, },