File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ else runSingle(userFileName);
3131function runAll ( ) {
3232 test ( 'testing mocks' , function ( t ) {
3333
34- var files = fs . readdirSync ( constants . pathToTestImageMocks ) ;
34+ var allMocks = fs . readdirSync ( constants . pathToTestImageMocks ) ;
3535
3636 /*
3737 * Some test cases exhibit run-to-run randomness;
@@ -45,10 +45,16 @@ function runAll () {
4545 * - all gl2d (38)
4646 * - gl2d_bunny-hull (1)
4747 */
48- t . plan ( files . length - 40 ) ;
48+ t . plan ( allMocks . length - 40 ) ;
4949
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 ) ;
5258 }
5359
5460 } ) ;
You can’t perform that action at this time.
0 commit comments