@@ -6,9 +6,10 @@ var Doc = reporters.Doc;
6
6
describe ( 'Doc reporter' , function ( ) {
7
7
var stdout ;
8
8
var stdoutWrite ;
9
- var runner = { } ;
9
+ var runner ;
10
10
beforeEach ( function ( ) {
11
11
stdout = [ ] ;
12
+ runner = { } ;
12
13
stdoutWrite = process . stdout . write ;
13
14
process . stdout . write = function ( string ) {
14
15
stdout . push ( string ) ;
@@ -24,7 +25,7 @@ describe('Doc reporter', function () {
24
25
title : expectedTitle
25
26
} ;
26
27
it ( 'should log html with indents and expected title' , function ( ) {
27
- runner . on = function ( event , callback ) {
28
+ runner . on = runner . once = function ( event , callback ) {
28
29
if ( event === 'suite' ) {
29
30
callback ( suite ) ;
30
31
}
@@ -44,7 +45,7 @@ describe('Doc reporter', function () {
44
45
title : unescapedTitle
45
46
} ;
46
47
expectedTitle = '<div>' + expectedTitle + '</div>' ;
47
- runner . on = function ( event , callback ) {
48
+ runner . on = runner . once = function ( event , callback ) {
48
49
if ( event === 'suite' ) {
49
50
callback ( suite ) ;
50
51
}
@@ -64,7 +65,7 @@ describe('Doc reporter', function () {
64
65
root : true
65
66
} ;
66
67
it ( 'should not log any html' , function ( ) {
67
- runner . on = function ( event , callback ) {
68
+ runner . on = runner . once = function ( event , callback ) {
68
69
if ( event === 'suite' ) {
69
70
callback ( suite ) ;
70
71
}
@@ -82,7 +83,7 @@ describe('Doc reporter', function () {
82
83
root : false
83
84
} ;
84
85
it ( 'should log expected html with indents' , function ( ) {
85
- runner . on = function ( event , callback ) {
86
+ runner . on = runner . once = function ( event , callback ) {
86
87
if ( event === 'suite end' ) {
87
88
callback ( suite ) ;
88
89
}
@@ -100,7 +101,7 @@ describe('Doc reporter', function () {
100
101
root : true
101
102
} ;
102
103
it ( 'should not log any html' , function ( ) {
103
- runner . on = function ( event , callback ) {
104
+ runner . on = runner . once = function ( event , callback ) {
104
105
if ( event === 'suite end' ) {
105
106
callback ( suite ) ;
106
107
}
@@ -123,7 +124,7 @@ describe('Doc reporter', function () {
123
124
}
124
125
} ;
125
126
it ( 'should log html with indents and expected title and body' , function ( ) {
126
- runner . on = function ( event , callback ) {
127
+ runner . on = runner . once = function ( event , callback ) {
127
128
if ( event === 'pass' ) {
128
129
callback ( test ) ;
129
130
}
@@ -144,7 +145,7 @@ describe('Doc reporter', function () {
144
145
145
146
var expectedEscapedTitle = '<div>' + expectedTitle + '</div>' ;
146
147
var expectedEscapedBody = '<div>' + expectedBody + '</div>' ;
147
- runner . on = function ( event , callback ) {
148
+ runner . on = runner . once = function ( event , callback ) {
148
149
if ( event === 'pass' ) {
149
150
callback ( test ) ;
150
151
}
@@ -171,7 +172,7 @@ describe('Doc reporter', function () {
171
172
}
172
173
} ;
173
174
it ( 'should log html with indents and expected title, body and error' , function ( ) {
174
- runner . on = function ( event , callback ) {
175
+ runner . on = runner . once = function ( event , callback ) {
175
176
if ( event === 'fail' ) {
176
177
callback ( test , expectedError ) ;
177
178
}
@@ -195,7 +196,7 @@ describe('Doc reporter', function () {
195
196
var expectedEscapedTitle = '<div>' + expectedTitle + '</div>' ;
196
197
var expectedEscapedBody = '<div>' + expectedBody + '</div>' ;
197
198
var expectedEscapedError = '<div>' + expectedError + '</div>' ;
198
- runner . on = function ( event , callback ) {
199
+ runner . on = runner . once = function ( event , callback ) {
199
200
if ( event === 'fail' ) {
200
201
callback ( test , unescapedError ) ;
201
202
}
0 commit comments