Skip to content

Commit 5830931

Browse files
pmarchinimarco-ippolito
authored andcommitted
test_runner: replace ansi clear with ansi reset
PR-URL: #55013Fixes: #55009 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent cc14622 commit 5830931

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

‎lib/internal/test_runner/reporter/dot.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ module.exports = async function* dot(source){
1212
constfailedTests=[];
1313
forawait(const{ type, data }ofsource){
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‎

Lines changed: 2 additions & 0 deletions
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
},
Lines changed: 3 additions & 3 deletions
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)