File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -851,10 +851,15 @@ Runner.prototype.run = function(fn) {
851
851
filterOnly ( rootSuite ) ;
852
852
}
853
853
self . started = true ;
854
- self . emit ( 'start' ) ;
854
+ Runner . immediately ( function ( ) {
855
+ self . emit ( 'start' ) ;
856
+ } ) ;
857
+
855
858
self . runSuite ( rootSuite , function ( ) {
856
859
debug ( 'finished running' ) ;
857
- self . emit ( 'end' ) ;
860
+ Runner . immediately ( function ( ) {
861
+ self . emit ( 'end' ) ;
862
+ } ) ;
858
863
} ) ;
859
864
}
860
865
Original file line number Diff line number Diff line change @@ -34,6 +34,16 @@ describe('Mocha', function() {
34
34
} ) ;
35
35
}
36
36
) ;
37
+
38
+ it ( 'should emit start event' , function ( done ) {
39
+ var mocha = new Mocha ( blankOpts ) ;
40
+ mocha . run ( ) . on ( 'start' , done ) ;
41
+ } ) ;
42
+
43
+ it ( 'should emit end event' , function ( done ) {
44
+ var mocha = new Mocha ( blankOpts ) ;
45
+ mocha . run ( ) . on ( 'end' , done ) ;
46
+ } ) ;
37
47
} ) ;
38
48
39
49
describe ( '.addFile()' , function ( ) {
You can’t perform that action at this time.
0 commit comments