From 5e96c1e076b42d8d317e37fb68ec30c26021620c Mon Sep 17 00:00:00 2001 From: Aidan Chadha Date: Sat, 30 Mar 2024 15:02:32 -0400 Subject: [PATCH 1/3] lib: changed the colors of X's and .'s in test_runner dot reporter Fixes: https://github.com/nodejs/node/issues/51770 --- lib/internal/test_runner/reporter/dot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/test_runner/reporter/dot.js b/lib/internal/test_runner/reporter/dot.js index 496c819d69ea07..183ccb09516238 100644 --- a/lib/internal/test_runner/reporter/dot.js +++ b/lib/internal/test_runner/reporter/dot.js @@ -1,15 +1,16 @@ 'use strict'; const { MathMax } = primordials; +const { red, green, clear } = require('././util/colors.js'); module.exports = async function* dot(source) { let count = 0; let columns = getLineLength(); for await (const { type } of source) { if (type === 'test:pass') { - yield '.'; + yield '${colors.green}.${colors.reset}'; } if (type === 'test:fail') { - yield 'X'; + yield '${colors.red}X${colors.reset}'; } if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { yield '\n'; From 55f3d42211564c2212acf3c5d123600704a576eb Mon Sep 17 00:00:00 2001 From: Aidan Chadha Date: Sat, 30 Mar 2024 15:10:53 -0400 Subject: [PATCH 2/3] fixed file import and color usage --- lib/internal/test_runner/reporter/dot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/test_runner/reporter/dot.js b/lib/internal/test_runner/reporter/dot.js index 183ccb09516238..b31c8a127f9b68 100644 --- a/lib/internal/test_runner/reporter/dot.js +++ b/lib/internal/test_runner/reporter/dot.js @@ -1,16 +1,16 @@ 'use strict'; const { MathMax } = primordials; -const { red, green, clear } = require('././util/colors.js'); +const { red, green, clear } = require('internal/util/colors'); module.exports = async function* dot(source) { let count = 0; let columns = getLineLength(); for await (const { type } of source) { if (type === 'test:pass') { - yield '${colors.green}.${colors.reset}'; + yield '${green}.${clear}'; } if (type === 'test:fail') { - yield '${colors.red}X${colors.reset}'; + yield '${red}X${clear}'; } if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { yield '\n'; From 8dc7c8aa94bc0a86ccdf2ab274878f1ebad2388b Mon Sep 17 00:00:00 2001 From: Aidan Chadha Date: Sat, 30 Mar 2024 15:14:58 -0400 Subject: [PATCH 3/3] lib: adds colors to X's and .'s in test_runner dot reporter --- lib/internal/test_runner/reporter/dot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/test_runner/reporter/dot.js b/lib/internal/test_runner/reporter/dot.js index b31c8a127f9b68..357a251ae73c87 100644 --- a/lib/internal/test_runner/reporter/dot.js +++ b/lib/internal/test_runner/reporter/dot.js @@ -7,10 +7,10 @@ module.exports = async function* dot(source) { let columns = getLineLength(); for await (const { type } of source) { if (type === 'test:pass') { - yield '${green}.${clear}'; + yield `${green}.${clear}`; } if (type === 'test:fail') { - yield '${red}X${clear}'; + yield `${red}X${clear}`; } if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { yield '\n';