File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -24,16 +24,16 @@ function createHarness (conf_) {
24
24
var pending = [ ] ;
25
25
var running = false ;
26
26
var count = 0 ;
27
-
27
+
28
28
var began = false ;
29
29
var closed = false ;
30
30
var out = new Render ( ) ;
31
-
31
+
32
32
var test = function ( name , conf , cb ) {
33
33
count ++ ;
34
34
var t = new Test ( name , conf , cb ) ;
35
35
if ( ! conf || typeof conf !== 'object' ) conf = conf_ || { } ;
36
-
36
+
37
37
if ( conf . exit !== false ) {
38
38
onexit ( function ( code ) {
39
39
t . _exit ( ) ;
@@ -44,34 +44,34 @@ function createHarness (conf_) {
44
44
if ( ! code && ! t . _ok ) process . exit ( 1 ) ;
45
45
} ) ;
46
46
}
47
-
47
+
48
48
process . nextTick ( function ( ) {
49
49
if ( ! out . piped ) out . pipe ( createDefaultStream ( ) ) ;
50
50
if ( ! began ) out . begin ( ) ;
51
51
began = true ;
52
-
52
+
53
53
var run = function ( ) {
54
54
running = true ;
55
55
out . push ( t ) ;
56
56
t . run ( ) ;
57
57
} ;
58
-
58
+
59
59
if ( running || pending . length ) {
60
60
pending . push ( run ) ;
61
61
}
62
62
else run ( ) ;
63
63
} ) ;
64
-
64
+
65
65
t . on ( 'test' , function sub ( st ) {
66
66
count ++ ;
67
67
st . on ( 'test' , sub ) ;
68
68
st . on ( 'end' , onend ) ;
69
69
} ) ;
70
-
70
+
71
71
t . on ( 'end' , onend ) ;
72
-
72
+
73
73
return t ;
74
-
74
+
75
75
function onend ( ) {
76
76
count -- ;
77
77
if ( this . _progeny . length ) {
@@ -84,7 +84,7 @@ function createHarness (conf_) {
84
84
} ) ;
85
85
pending . unshift . apply ( pending , unshifts ) ;
86
86
}
87
-
87
+
88
88
process . nextTick ( function ( ) {
89
89
running = false ;
90
90
if ( pending . length ) return pending . shift ( ) ( ) ;
@@ -98,7 +98,7 @@ function createHarness (conf_) {
98
98
} ) ;
99
99
}
100
100
} ;
101
-
101
+
102
102
test . stream = out ;
103
103
return test ;
104
104
}
You can’t perform that action at this time.
0 commit comments