File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ exports = module.exports = createHarness();
20
20
exports . createHarness = createHarness ;
21
21
exports . Test = Test ;
22
22
23
+ var exitInterval ;
24
+
23
25
function createHarness ( conf_ ) {
24
26
var pending = [ ] ;
25
27
var running = false ;
@@ -32,7 +34,9 @@ function createHarness (conf_) {
32
34
if ( ! conf_ ) conf_ = { } ;
33
35
34
36
var tests = [ ] ;
35
- var exitInterval = conf_ . exitInterval !== false && canEmitExit
37
+ if ( conf_ . exit === false && exitInterval ) clearInterval ( exitInterval ) ;
38
+
39
+ exitInterval = ! exitInterval && conf_ . exit !== false && canEmitExit
36
40
&& typeof process . _getActiveHandles === 'function'
37
41
&& setInterval ( function ( ) {
38
42
if ( process . _getActiveHandles ( ) . length === 1 ) {
@@ -45,7 +49,7 @@ function createHarness (conf_) {
45
49
46
50
out . on ( 'end' , function ( ) {
47
51
clearInterval ( exitInterval ) ;
48
- process . exit ( exitCode ) ;
52
+ if ( conf_ . exit !== false ) process . exit ( exitCode ) ;
49
53
} ) ;
50
54
51
55
var test = function ( name , conf , cb ) {
@@ -94,6 +98,7 @@ function createHarness (conf_) {
94
98
st . on ( 'test' , sub ) ;
95
99
st . on ( 'end' , onend ) ;
96
100
} ) ;
101
+ t . on ( 'result' , function ( r ) { if ( ! r . ok ) exitCode = 1 } ) ;
97
102
98
103
t . on ( 'end' , onend ) ;
99
104
You can’t perform that action at this time.
0 commit comments