@@ -12,13 +12,16 @@ describe('Priority', function () {
1212 it ( 'Should do basic ordering' , function ( ) {
1313 c = makeTest ( { maxConcurrent : 1 , minTime : 100 , rejectOnDrop : false } )
1414
15- c . limiter . submit ( c . slowJob , 50 , null , 1 , c . noErrVal ( 1 ) )
16- c . limiter . submit ( c . job , null , 2 , c . noErrVal ( 2 ) )
17- c . limiter . submit ( c . job , null , 3 , c . noErrVal ( 3 ) )
18- c . limiter . submit ( c . job , null , 4 , c . noErrVal ( 4 ) )
19- c . limiter . submit ( { priority : 1 } , c . job , null , 5 , 6 , c . noErrVal ( 5 , 6 ) )
20-
21- return c . last ( )
15+ return Promise . all ( [
16+ c . pNoErrVal ( c . limiter . schedule ( c . slowPromise , 50 , null , 1 ) , 1 ) ,
17+ c . pNoErrVal ( c . limiter . schedule ( c . promise , null , 2 ) , 2 ) ,
18+ c . pNoErrVal ( c . limiter . schedule ( { priority : 1 } , c . promise , null , 5 , 6 ) , 5 , 6 ) ,
19+ c . pNoErrVal ( c . limiter . schedule ( c . promise , null , 3 ) , 3 ) ,
20+ c . pNoErrVal ( c . limiter . schedule ( c . promise , null , 4 ) , 4 )
21+ ] )
22+ . then ( function ( ) {
23+ return c . last ( )
24+ } )
2225 . then ( function ( results ) {
2326 c . checkResultsOrder ( [ [ 1 ] , [ 5 , 6 ] , [ 2 ] , [ 3 ] , [ 4 ] ] )
2427 c . checkDuration ( 400 )
0 commit comments