File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ var options = {
62
62
watch : false ,
63
63
coverage : false ,
64
64
isolate : false ,
65
+ shuffle : false ,
65
66
nocolor : ! process . stdout . isTTY
66
67
} ;
67
68
@@ -141,6 +142,9 @@ while (arg = argv.shift()) {
141
142
case 'supress-stdout' :
142
143
options . supressStdout = true ;
143
144
break ;
145
+ case 'shuffle' :
146
+ options . shuffle = true ;
147
+ break ;
144
148
case 'isolate' :
145
149
case 'i' :
146
150
options . isolate = true ;
@@ -240,6 +244,14 @@ if (! options.watch) {
240
244
: a . replace ( fileExt , '' ) ;
241
245
} ) ;
242
246
247
+ if ( options . shuffle ) {
248
+ var source = files . slice ( 0 ) ;
249
+ files . length = 0 ;
250
+ while ( source . length ) {
251
+ files . push ( source . splice ( Math . ceil ( Math . random ( ) * source . length ) - 1 , 1 ) [ 0 ] ) ;
252
+ }
253
+ }
254
+
243
255
runSuites ( importSuites ( files ) , function ( results ) {
244
256
var status = results . errored ? 2 : ( results . broken ? 1 : 0 ) ;
245
257
You can’t perform that action at this time.
0 commit comments