File tree Expand file tree Collapse file tree 4 files changed +42
-3
lines changed
fixture/fail-fast/without-error Expand file tree Collapse file tree 4 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,10 @@ class Api extends EventEmitter {
9898 runStatus . on ( 'test' , test => {
9999 if ( test . error ) {
100100 bailed = true ;
101- }
102101
103- for ( const fork of pendingForks ) {
104- fork . notifyOfPeerFailure ( ) ;
102+ for ( const fork of pendingForks ) {
103+ fork . notifyOfPeerFailure ( ) ;
104+ }
105105 }
106106 } ) ;
107107 }
Original file line number Diff line number Diff line change @@ -385,6 +385,37 @@ test('fail-fast mode - timeout & serial', t => {
385385 } ) ;
386386} ) ;
387387
388+ test ( 'fail-fast mode - no errors' , t => {
389+ const api = apiCreator ( {
390+ failFast : true
391+ } ) ;
392+
393+ const tests = [ ] ;
394+ const errors = [ ] ;
395+
396+ api . on ( 'test-run' , runStatus => {
397+ runStatus . on ( 'test' , test => {
398+ tests . push ( {
399+ ok : ! test . error ,
400+ title : test . title
401+ } ) ;
402+ } ) ;
403+ runStatus . on ( 'error' , err => {
404+ errors . push ( err ) ;
405+ } ) ;
406+ } ) ;
407+
408+ return api . run ( [
409+ path . join ( __dirname , 'fixture/fail-fast/without-error/a.js' ) ,
410+ path . join ( __dirname , 'fixture/fail-fast/without-error/b.js' )
411+ ] )
412+ . then ( result => {
413+ t . ok ( api . options . failFast ) ;
414+ t . is ( result . passCount , 2 ) ;
415+ t . is ( result . failCount , 0 ) ;
416+ } ) ;
417+ } ) ;
418+
388419test ( 'serial execution mode' , t => {
389420 const api = apiCreator ( {
390421 serial : true
Original file line number Diff line number Diff line change 1+ import test from '../../../..' ;
2+
3+ test ( 'pass' , t => t . pass ( ) ) ;
Original file line number Diff line number Diff line change 1+ import test from '../../../..' ;
2+
3+ setTimeout ( ( ) => {
4+ test . serial ( 'pass' , t => t . pass ( ) ) ;
5+ } , 2000 ) ;
You can’t perform that action at this time.
0 commit comments