From bc1c762e0d847dc3a724d552802bd523f63824d2 Mon Sep 17 00:00:00 2001 From: Jamie King Date: Tue, 12 Mar 2024 04:10:55 -0700 Subject: [PATCH] test(printRestult): force color --- test/printResult.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/printResult.test.js b/test/printResult.test.js index 90c9c148..9c3a80a2 100644 --- a/test/printResult.test.js +++ b/test/printResult.test.js @@ -179,6 +179,8 @@ test('should print with color when color is supported', (t) => { } } + const { FORCE_COLOR } = process.env + process.env.FORCE_COLOR = '1' const outputStream = new Writable({ write () {} }) @@ -187,6 +189,7 @@ test('should print with color when color is supported', (t) => { // act const output = printResult(result, { outputStream }) t.ok(ansiRegex().test(output)) + process.env.FORCE_COLOR = FORCE_COLOR }) test('should not print with any color when color is not supported', (t) => {