Skip to content

Commit 4b962a7

Browse files
pmarchinitargos
authored andcommitted
test_runner: replace ansi clear with ansi reset
PR-URL: #55013 Fixes: #55009 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 1e53c10 commit 4b962a7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/internal/test_runner/reporter/dot.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ module.exports = async function* dot(source) {
1212
const failedTests = [];
1313
for await (const { type, data } of source) {
1414
if (type === 'test:pass') {
15-
yield `${colors.green}.${colors.clear}`;
15+
yield `${colors.green}.${colors.reset}`;
1616
}
1717
if (type === 'test:fail') {
18-
yield `${colors.red}X${colors.clear}`;
18+
yield `${colors.red}X${colors.reset}`;
1919
ArrayPrototypePush(failedTests, data);
2020
}
2121
if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) {

lib/internal/util/colors.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
red: '',
1414
gray: '',
1515
clear: '',
16+
reset: '',
1617
hasColors: false,
1718
shouldColorize(stream) {
1819
if (process.env.FORCE_COLOR !== undefined) {
@@ -32,6 +33,7 @@ module.exports = {
3233
module.exports.red = hasColors ? '\u001b[31m' : '';
3334
module.exports.gray = hasColors ? '\u001b[90m' : '';
3435
module.exports.clear = hasColors ? '\u001bc' : '';
36+
module.exports.reset = hasColors ? '\u001b[0m' : '';
3537
module.exports.hasColors = hasColors;
3638
}
3739
},
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[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
2-
[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
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
1+
[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
2+
[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
3+
[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

0 commit comments

Comments
 (0)