print strings normally without util inspect

This commit is contained in:
Tommy D. Rossi
2026-02-02 13:21:27 +01:00
parent 1001f7eba0
commit 1ad6b0d74f
+5 -1
View File
@@ -381,6 +381,7 @@ export class PlaywrightExecutor {
logs.forEach(({ method, args }) => {
const formattedArgs = args
.map((arg) => {
if (typeof arg === 'string') return arg
return util.inspect(arg, { depth: 4, colors: false, maxArrayLength: 100, breakLength: 80 })
})
.join(' ')
@@ -660,7 +661,10 @@ export class PlaywrightExecutor {
if (hasExplicitReturn) {
const resolvedResult = isPromise(result) ? await result : result
if (resolvedResult !== undefined) {
const formatted = util.inspect(resolvedResult, { depth: 4, colors: false, maxArrayLength: 100, breakLength: 80 })
const formatted = typeof resolvedResult === "string"
? resolvedResult
: util.inspect(resolvedResult, { depth: 4, colors: false, maxArrayLength: 100, breakLength: 80 })
if (formatted.trim()) {
responseText += `[return value] ${formatted}\n`
}