diff --git a/lib/internal/test_runner/reporter/dot.js b/lib/internal/test_runner/reporter/dot.js index 1e581f7a337845..45ff047bc4e5a0 100644 --- a/lib/internal/test_runner/reporter/dot.js +++ b/lib/internal/test_runner/reporter/dot.js @@ -12,10 +12,10 @@ module.exports = async function* dot(source) { const failedTests = []; for await (const { type, data } of source) { if (type === 'test:pass') { - yield `${colors.green}.${colors.clear}`; + yield `${colors.green}.${colors.reset}`; } if (type === 'test:fail') { - yield `${colors.red}X${colors.clear}`; + yield `${colors.red}X${colors.reset}`; ArrayPrototypePush(failedTests, data); } if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { diff --git a/lib/internal/util/colors.js b/lib/internal/util/colors.js index 31e3e9b22585c5..054f9c4b4090d8 100644 --- a/lib/internal/util/colors.js +++ b/lib/internal/util/colors.js @@ -13,6 +13,7 @@ module.exports = { red: '', gray: '', clear: '', + reset: '', hasColors: false, shouldColorize(stream) { if (process.env.FORCE_COLOR !== undefined) { @@ -32,6 +33,7 @@ module.exports = { module.exports.red = hasColors ? '\u001b[31m' : ''; module.exports.gray = hasColors ? '\u001b[90m' : ''; module.exports.clear = hasColors ? '\u001bc' : ''; + module.exports.reset = hasColors ? '\u001b[0m' : ''; module.exports.hasColors = hasColors; } }, diff --git a/test/fixtures/test-runner/output/dot_output_custom_columns.snapshot b/test/fixtures/test-runner/output/dot_output_custom_columns.snapshot index b315dd77465a37..2c9c5aecda20fe 100644 --- a/test/fixtures/test-runner/output/dot_output_custom_columns.snapshot +++ b/test/fixtures/test-runner/output/dot_output_custom_columns.snapshot @@ -1,3 +1,3 @@ -[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c -[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c -[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c[32m.c +[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m +[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m +[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m