File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -324,8 +324,11 @@ Runnable.prototype.run = function (fn) {
324
324
}
325
325
326
326
if ( this . allowUncaught ) {
327
- callFn ( this . fn ) ;
328
- done ( ) ;
327
+ if ( this . isPending ( ) ) {
328
+ done ( ) ;
329
+ } else {
330
+ callFn ( this . fn ) ;
331
+ }
329
332
return ;
330
333
}
331
334
Original file line number Diff line number Diff line change @@ -432,15 +432,14 @@ Runner.prototype.runTest = function (fn) {
432
432
if ( this . asyncOnly ) {
433
433
test . asyncOnly = true ;
434
434
}
435
-
435
+ test . on ( 'error' , function ( err ) {
436
+ self . fail ( test , err ) ;
437
+ } ) ;
436
438
if ( this . allowUncaught ) {
437
439
test . allowUncaught = true ;
438
440
return test . run ( fn ) ;
439
441
}
440
442
try {
441
- test . on ( 'error' , function ( err ) {
442
- self . fail ( test , err ) ;
443
- } ) ;
444
443
test . run ( fn ) ;
445
444
} catch ( err ) {
446
445
fn ( err ) ;
You can’t perform that action at this time.
0 commit comments