File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -402,3 +402,29 @@ test('t.end is called when a promise passed to t.throws hasn\'t rejected yet', f
402
402
t . end ( ) ;
403
403
} ) ;
404
404
} ) ;
405
+
406
+ test ( 'test returns a promise that resolves before a promise passed to t.throws resolves' , function ( t ) {
407
+ ava ( function ( a ) {
408
+ a . plan ( 1 ) ;
409
+ a . doesNotThrow ( delay ( Promise . resolve ( ) , 10 ) , 'foo' ) ;
410
+ return Promise . resolve ( ) ;
411
+ } ) . run ( ) . then ( function ( a ) {
412
+ t . ifError ( a . assertError ) ;
413
+ t . is ( a . planCount , 1 ) ;
414
+ t . is ( a . assertCount , 1 ) ;
415
+ t . end ( ) ;
416
+ } ) ;
417
+ } ) ;
418
+
419
+ test ( 'test returns a promise that resolves before a promise passed to t.throws rejects' , function ( t ) {
420
+ ava ( function ( a ) {
421
+ a . plan ( 1 ) ;
422
+ a . throws ( delay ( Promise . reject ( new Error ( 'foo' ) ) , 10 ) , 'foo' ) ;
423
+ return Promise . resolve ( ) ;
424
+ } ) . run ( ) . then ( function ( a ) {
425
+ t . ifError ( a . assertError ) ;
426
+ t . is ( a . planCount , 1 ) ;
427
+ t . is ( a . assertCount , 1 ) ;
428
+ t . end ( ) ;
429
+ } ) ;
430
+ } ) ;
You can’t perform that action at this time.
0 commit comments