Skip to content

Commit 10df8b2

Browse files
authored
fix: step arg is a function (#4092)
* fix: step arg is a function
1 parent 474b5e1 commit 10df8b2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/command/workers/runTests.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,15 @@ function initializeListeners() {
145145

146146
if (step.args) {
147147
for (const arg of step.args) {
148-
arg && arg.$_root ? _args.push(JSON.stringify(arg).slice(0, 300)) : _args.push(arg);
148+
// check if arg is a JOI object
149+
if (arg && arg.$_root) {
150+
_args.push(JSON.stringify(arg).slice(0, 300));
151+
// check if arg is a function
152+
} else if (arg && typeof arg === 'function') {
153+
_args.push(arg.name);
154+
} else {
155+
_args.push(arg);
156+
}
149157
}
150158
}
151159

0 commit comments

Comments
 (0)