@@ -16,16 +16,19 @@ test('does nothing without .errors and .warnings', () => {
16
16
} ) ;
17
17
18
18
test ( 'returns empty summary if verbose' , ( ) => {
19
- const actual = format ( {
20
- results : [
21
- {
22
- errors : [ ] ,
23
- warnings : [ ]
24
- }
25
- ]
26
- } , {
27
- verbose : true
28
- } ) ;
19
+ const actual = format (
20
+ {
21
+ results : [
22
+ {
23
+ errors : [ ] ,
24
+ warnings : [ ]
25
+ }
26
+ ]
27
+ } ,
28
+ {
29
+ verbose : true
30
+ }
31
+ ) ;
29
32
30
33
expect ( actual ) . toContain ( '0 problems, 0 warnings' ) ;
31
34
} ) ;
@@ -181,67 +184,76 @@ test('format result transforms warning to text', () => {
181
184
} ) ;
182
185
183
186
test ( 'format result prints help for errors' , ( ) => {
184
- const actual = formatResult ( {
185
- errors : [
186
- {
187
- level : 2 ,
188
- name : 'error-name' ,
189
- message : 'There was an error'
190
- }
191
- ]
192
- } , {
193
- helpUrl : 'https://example.com'
194
- } ) ;
187
+ const actual = formatResult (
188
+ {
189
+ errors : [
190
+ {
191
+ level : 2 ,
192
+ name : 'error-name' ,
193
+ message : 'There was an error'
194
+ }
195
+ ]
196
+ } ,
197
+ {
198
+ helpUrl : 'https://example.com'
199
+ }
200
+ ) ;
195
201
196
- expect ( actual ) . toEqual ( expect . arrayContaining ( [
197
- expect . stringContaining ( 'Get help:' )
198
- ] ) ) ;
202
+ expect ( actual ) . toEqual (
203
+ expect . arrayContaining ( [ expect . stringContaining ( 'Get help:' ) ] )
204
+ ) ;
199
205
} ) ;
200
206
201
207
test ( 'format result prints help for warnings' , ( ) => {
202
- const actual = formatResult ( {
203
- warnings : [
204
- {
205
- level : 2 ,
206
- name : 'warning-name' ,
207
- message : 'There was a warning'
208
- }
209
- ]
210
- } , {
211
- helpUrl : 'https://example.com'
212
- } ) ;
208
+ const actual = formatResult (
209
+ {
210
+ warnings : [
211
+ {
212
+ level : 2 ,
213
+ name : 'warning-name' ,
214
+ message : 'There was a warning'
215
+ }
216
+ ]
217
+ } ,
218
+ {
219
+ helpUrl : 'https://example.com'
220
+ }
221
+ ) ;
213
222
214
- expect ( actual ) . toEqual ( expect . arrayContaining ( [
215
- expect . stringContaining ( 'Get help:' )
216
- ] ) ) ;
223
+ expect ( actual ) . toEqual (
224
+ expect . arrayContaining ( [ expect . stringContaining ( 'Get help:' ) ] )
225
+ ) ;
217
226
} ) ;
218
227
219
228
test ( 'format result help cotains options.helpUrl' , ( ) => {
220
229
const helpUrl = 'https://example.com' ;
221
230
222
- const actual = formatResult ( {
223
- warnings : [
224
- {
225
- level : 2 ,
226
- name : 'warning-name' ,
227
- message : 'There was a warning'
228
- }
229
- ]
230
- } , {
231
- helpUrl
232
- } ) ;
231
+ const actual = formatResult (
232
+ {
233
+ warnings : [
234
+ {
235
+ level : 2 ,
236
+ name : 'warning-name' ,
237
+ message : 'There was a warning'
238
+ }
239
+ ]
240
+ } ,
241
+ {
242
+ helpUrl
243
+ }
244
+ ) ;
233
245
234
- expect ( actual ) . toEqual ( expect . arrayContaining ( [
235
- expect . stringContaining ( helpUrl )
236
- ] ) ) ;
246
+ expect ( actual ) . toEqual (
247
+ expect . arrayContaining ( [ expect . stringContaining ( helpUrl ) ] )
248
+ ) ;
237
249
} ) ;
238
250
239
251
test ( 'format result omits help for empty problems' , ( ) => {
240
252
const actual = formatResult ( {
241
253
warnings : [ ]
242
254
} ) ;
243
255
244
- expect ( actual ) . not . toEqual ( expect . arrayContaining ( [
245
- expect . stringContaining ( 'Get help:' )
246
- ] ) ) ;
256
+ expect ( actual ) . not . toEqual (
257
+ expect . arrayContaining ( [ expect . stringContaining ( 'Get help:' ) ] )
258
+ ) ;
247
259
} ) ;
0 commit comments