Skip to content

Commit

Permalink
Fix command args showing as '[object Object]' in reporter.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Apr 23, 2024
1 parent a0a74f8 commit 6e9fd5f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/reporter/index.js
Expand Up @@ -238,7 +238,17 @@ class Reporter extends SimplifiedReporter {

static stringifyArgs(args) {
if (Array.isArray(args)) {
return args.map((arg) => arg && arg.toString());
return args.map((arg) => {
let stringifiedArg;

try {
stringifiedArg = JSON.stringify(arg);
} catch {
stringifiedArg = arg && arg.toString();
}

return stringifiedArg;
});
}

return args;
Expand Down

0 comments on commit 6e9fd5f

Please sign in to comment.