Skip to content

Commit

Permalink
fix: force colors from workers when stdout is TTY
Browse files Browse the repository at this point in the history
Signed-off-by: Chapman Pendery <[email protected]>
  • Loading branch information
cpendery committed Mar 1, 2024
1 parent 32bb526 commit c1cf904
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/runner/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ListReporter } from "../reporter/list.js";
import { BaseReporter } from "../reporter/base.js";
import { TestCase } from "../test/testcase.js";
import { cacheFolderName, executableName } from "../utils/constants.js";
import { supportsColor } from "chalk";

/* eslint-disable no-var */

Expand All @@ -34,7 +35,12 @@ export const maxWorkers = Math.max(Math.floor(os.cpus().length / 2), 1);
const pool = workerpool.pool(path.join(__dirname, "worker.js"), {
workerType: "process",
maxWorkers,
forkOpts: { stdio: "inherit" },
forkOpts: {
stdio: "inherit",
env: {
...(supportsColor ? { FORCE_COLOR: "1" } : {}),
},
},
emitStdStreams: true,
});

Expand Down

0 comments on commit c1cf904

Please sign in to comment.