@@ -6,7 +6,7 @@ var reporters = require('../../').reporters;
6
6
7
7
var Doc = reporters . Doc ;
8
8
var createMockRunner = helpers . createMockRunner ;
9
- var makeRunReporter = helpers . createRunReporterFunction ;
9
+ var createRunReporterFunction = helpers . createRunReporterFunction ;
10
10
11
11
var EVENT_SUITE_BEGIN = events . EVENT_SUITE_BEGIN ;
12
12
var EVENT_SUITE_END = events . EVENT_SUITE_END ;
@@ -16,7 +16,7 @@ var EVENT_TEST_PASS = events.EVENT_TEST_PASS;
16
16
describe ( 'Doc reporter' , function ( ) {
17
17
var runner ;
18
18
var options = { } ;
19
- var runReporter = makeRunReporter ( Doc ) ;
19
+ var runReporter = createRunReporterFunction ( Doc ) ;
20
20
21
21
afterEach ( function ( ) {
22
22
runner = null ;
@@ -32,15 +32,15 @@ describe('Doc reporter', function () {
32
32
title : expectedTitle
33
33
} ;
34
34
35
- it ( 'should log html with indents and expected title' , function ( ) {
35
+ it ( 'should log html with indents and expected title' , async function ( ) {
36
36
runner = createMockRunner (
37
37
'suite' ,
38
38
EVENT_SUITE_BEGIN ,
39
39
null ,
40
40
null ,
41
41
suite
42
42
) ;
43
- var stdout = runReporter ( this , runner , options ) ;
43
+ var { stdout} = await runReporter ( { } , runner , options ) ;
44
44
var expectedArray = [
45
45
' <section class="suite">\n' ,
46
46
' <h1>' + expectedTitle + '</h1>\n' ,
@@ -49,7 +49,7 @@ describe('Doc reporter', function () {
49
49
expect ( stdout , 'to equal' , expectedArray ) ;
50
50
} ) ;
51
51
52
- it ( 'should escape title where necessary' , function ( ) {
52
+ it ( 'should escape title where necessary' , async function ( ) {
53
53
var suite = {
54
54
root : false ,
55
55
title : unescapedTitle
@@ -64,7 +64,7 @@ describe('Doc reporter', function () {
64
64
null ,
65
65
suite
66
66
) ;
67
- var stdout = runReporter ( this , runner , options ) ;
67
+ var { stdout} = await runReporter ( { } , runner , options ) ;
68
68
var expectedArray = [
69
69
' <section class="suite">\n' ,
70
70
' <h1>' + expectedTitle + '</h1>\n' ,
@@ -79,15 +79,15 @@ describe('Doc reporter', function () {
79
79
root : true
80
80
} ;
81
81
82
- it ( 'should not log any html' , function ( ) {
82
+ it ( 'should not log any html' , async function ( ) {
83
83
runner = createMockRunner (
84
84
'suite' ,
85
85
EVENT_SUITE_BEGIN ,
86
86
null ,
87
87
null ,
88
88
suite
89
89
) ;
90
- var stdout = runReporter ( this , runner , options ) ;
90
+ var { stdout} = await runReporter ( { } , runner , options ) ;
91
91
expect ( stdout , 'to be empty' ) ;
92
92
} ) ;
93
93
} ) ;
@@ -99,15 +99,15 @@ describe('Doc reporter', function () {
99
99
root : false
100
100
} ;
101
101
102
- it ( 'should log expected html with indents' , function ( ) {
102
+ it ( 'should log expected html with indents' , async function ( ) {
103
103
runner = createMockRunner (
104
104
'suite end' ,
105
105
EVENT_SUITE_END ,
106
106
null ,
107
107
null ,
108
108
suite
109
109
) ;
110
- var stdout = runReporter ( this , runner , options ) ;
110
+ var { stdout} = await runReporter ( { } , runner , options ) ;
111
111
var expectedArray = [ ' </dl>\n' , '</section>\n' ] ;
112
112
expect ( stdout , 'to equal' , expectedArray ) ;
113
113
} ) ;
@@ -118,15 +118,15 @@ describe('Doc reporter', function () {
118
118
root : true
119
119
} ;
120
120
121
- it ( 'should not log any html' , function ( ) {
121
+ it ( 'should not log any html' , async function ( ) {
122
122
runner = createMockRunner (
123
123
'suite end' ,
124
124
EVENT_SUITE_END ,
125
125
null ,
126
126
null ,
127
127
suite
128
128
) ;
129
- var stdout = runReporter ( this , runner , options ) ;
129
+ var { stdout} = await runReporter ( { } , runner , options ) ;
130
130
expect ( stdout , 'to be empty' ) ;
131
131
} ) ;
132
132
} ) ;
@@ -145,9 +145,9 @@ describe('Doc reporter', function () {
145
145
}
146
146
} ;
147
147
148
- it ( 'should log html with indents, expected title, and body' , function ( ) {
148
+ it ( 'should log html with indents, expected title, and body' , async function ( ) {
149
149
runner = createMockRunner ( 'pass' , EVENT_TEST_PASS , null , null , test ) ;
150
- var stdout = runReporter ( this , runner , options ) ;
150
+ var { stdout} = await runReporter ( { } , runner , options ) ;
151
151
var expectedArray = [
152
152
' <dt>' + expectedTitle + '</dt>\n' ,
153
153
' <dt>' + expectedFile + '</dt>\n' ,
@@ -156,7 +156,7 @@ describe('Doc reporter', function () {
156
156
expect ( stdout , 'to equal' , expectedArray ) ;
157
157
} ) ;
158
158
159
- it ( 'should escape title and body where necessary' , function ( ) {
159
+ it ( 'should escape title and body where necessary' , async function ( ) {
160
160
var unescapedTitle = '<div>' + expectedTitle + '</div>' ;
161
161
var unescapedFile = '<div>' + expectedFile + '</div>' ;
162
162
var unescapedBody = '<div>' + expectedBody + '</div>' ;
@@ -171,7 +171,7 @@ describe('Doc reporter', function () {
171
171
var expectedEscapedBody =
172
172
'<div>' + expectedBody + '</div>' ;
173
173
runner = createMockRunner ( 'pass' , EVENT_TEST_PASS , null , null , test ) ;
174
- var stdout = runReporter ( this , runner , options ) ;
174
+ var { stdout} = await runReporter ( { } , runner , options ) ;
175
175
var expectedArray = [
176
176
' <dt>' + expectedEscapedTitle + '</dt>\n' ,
177
177
' <dt>' + expectedEscapedFile + '</dt>\n' ,
@@ -195,7 +195,7 @@ describe('Doc reporter', function () {
195
195
}
196
196
} ;
197
197
198
- it ( 'should log html with indents, expected title, body, and error' , function ( ) {
198
+ it ( 'should log html with indents, expected title, body, and error' , async function ( ) {
199
199
runner = createMockRunner (
200
200
'fail two args' ,
201
201
EVENT_TEST_FAIL ,
@@ -204,7 +204,7 @@ describe('Doc reporter', function () {
204
204
test ,
205
205
expectedError
206
206
) ;
207
- var stdout = runReporter ( this , runner , options ) ;
207
+ var { stdout} = await runReporter ( { } , runner , options ) ;
208
208
var expectedArray = [
209
209
' <dt class="error">' + expectedTitle + '</dt>\n' ,
210
210
' <dt class="error">' + expectedFile + '</dt>\n' ,
@@ -216,7 +216,7 @@ describe('Doc reporter', function () {
216
216
expect ( stdout , 'to equal' , expectedArray ) ;
217
217
} ) ;
218
218
219
- it ( 'should escape title, body, and error where necessary' , function ( ) {
219
+ it ( 'should escape title, body, and error where necessary' , async function ( ) {
220
220
var unescapedTitle = '<div>' + expectedTitle + '</div>' ;
221
221
var unescapedFile = '<div>' + expectedFile + '</div>' ;
222
222
var unescapedBody = '<div>' + expectedBody + '</div>' ;
@@ -241,7 +241,7 @@ describe('Doc reporter', function () {
241
241
test ,
242
242
unescapedError
243
243
) ;
244
- var stdout = runReporter ( this , runner , options ) ;
244
+ var { stdout} = await runReporter ( { } , runner , options ) ;
245
245
var expectedArray = [
246
246
' <dt class="error">' + expectedEscapedTitle + '</dt>\n' ,
247
247
' <dt class="error">' + expectedEscapedFile + '</dt>\n' ,
0 commit comments