File tree 1 file changed +10
-4
lines changed
Filter options
1 file changed +10
-4
lines changed
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ else runSingle(userFileName);
31
31
function runAll ( ) {
32
32
test ( 'testing mocks' , function ( t ) {
33
33
34
- var files = fs . readdirSync ( constants . pathToTestImageMocks ) ;
34
+ var allMocks = fs . readdirSync ( constants . pathToTestImageMocks ) ;
35
35
36
36
/*
37
37
* Some test cases exhibit run-to-run randomness;
@@ -45,10 +45,16 @@ function runAll () {
45
45
* - all gl2d (38)
46
46
* - gl2d_bunny-hull (1)
47
47
*/
48
- t . plan ( files . length - 40 ) ;
48
+ t . plan ( allMocks . length - 40 ) ;
49
49
50
- for ( var i = 0 ; i < 20 ; i ++ ) {
51
- testMock ( files [ i ] , t ) ;
50
+ var BASE_TIMEOUT = 500 ,
51
+ BATCH_SIZE = 5 ,
52
+ cnt = 0 ;
53
+
54
+ for ( var i = 0 ; i < allMocks . length ; i ++ ) {
55
+ setTimeout ( function ( ) {
56
+ testMock ( allMocks [ cnt ++ ] , t ) ;
57
+ } , BASE_TIMEOUT * Math . floor ( i / BATCH_SIZE ) * BATCH_SIZE ) ;
52
58
}
53
59
54
60
} ) ;
You can’t perform that action at this time.
0 commit comments