File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,17 @@ class Reporter extends SimplifiedReporter {
238
238
239
239
static stringifyArgs ( args ) {
240
240
if ( Array . isArray ( args ) ) {
241
- return args . map ( ( arg ) => arg && arg . toString ( ) ) ;
241
+ return args . map ( ( arg ) => {
242
+ let stringifiedArg ;
243
+
244
+ try {
245
+ stringifiedArg = JSON . stringify ( arg ) ;
246
+ } catch {
247
+ stringifiedArg = arg && arg . toString ( ) ;
248
+ }
249
+
250
+ return stringifiedArg ;
251
+ } ) ;
242
252
}
243
253
244
254
return args ;
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ describe('testReporter', function() {
324
324
assert . ok ( Object . keys ( command ) . includes ( 'endTime' ) ) ;
325
325
assert . ok ( Object . keys ( command ) . includes ( 'elapsedTime' ) ) ;
326
326
assert . ok ( Object . keys ( command ) . includes ( 'result' ) ) ;
327
- assert . deepEqual ( command . args , [ 'http://localhost' ] ) ;
327
+ assert . deepEqual ( command . args , [ '" http://localhost" ' ] ) ;
328
328
assert . strictEqual ( command . status , 'pass' ) ;
329
329
}
330
330
} ,
You can’t perform that action at this time.
0 commit comments