File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ const FLAGS = {
91
91
description : 'Re-run tests when files change' ,
92
92
type : 'boolean' ,
93
93
} ,
94
+ cls : {
95
+ alias : 'C' ,
96
+ coerce : coerceLastValue ,
97
+ description : 'Clears the screen between test runs' ,
98
+ type : 'boolean' ,
99
+ } ,
94
100
} ;
95
101
96
102
export default async function loadCli ( ) { // eslint-disable-line complexity
@@ -465,6 +471,7 @@ export default async function loadCli() { // eslint-disable-line complexity
465
471
reportStream : process . stdout ,
466
472
stdStream : process . stderr ,
467
473
watching : argv . watch ,
474
+ cls : argv . cls ,
468
475
} ) ;
469
476
}
470
477
Original file line number Diff line number Diff line change @@ -73,12 +73,14 @@ export default class Reporter {
73
73
stdStream,
74
74
projectDir,
75
75
watching,
76
+ cls,
76
77
durationThreshold,
77
78
} ) {
78
79
this . extensions = extensions ;
79
80
this . reportStream = reportStream ;
80
81
this . stdStream = stdStream ;
81
82
this . watching = watching ;
83
+ this . cls = cls ;
82
84
this . relativeFile = file => {
83
85
if ( file . startsWith ( 'file://' ) ) {
84
86
file = fileURLToPath ( file ) ;
@@ -128,6 +130,10 @@ export default class Reporter {
128
130
}
129
131
130
132
startRun ( plan ) {
133
+ if ( this . cls ) {
134
+ this . lineWriter . write ( '\x1b[2J\x1b[H\x1b[3J' ) ;
135
+ }
136
+
131
137
if ( plan . bailWithoutReporting ) {
132
138
return ;
133
139
}
You can’t perform that action at this time.
0 commit comments