print strings normally without util inspect
This commit is contained in:
@@ -381,6 +381,7 @@ export class PlaywrightExecutor {
|
|||||||
logs.forEach(({ method, args }) => {
|
logs.forEach(({ method, args }) => {
|
||||||
const formattedArgs = args
|
const formattedArgs = args
|
||||||
.map((arg) => {
|
.map((arg) => {
|
||||||
|
if (typeof arg === 'string') return arg
|
||||||
return util.inspect(arg, { depth: 4, colors: false, maxArrayLength: 100, breakLength: 80 })
|
return util.inspect(arg, { depth: 4, colors: false, maxArrayLength: 100, breakLength: 80 })
|
||||||
})
|
})
|
||||||
.join(' ')
|
.join(' ')
|
||||||
@@ -660,7 +661,10 @@ export class PlaywrightExecutor {
|
|||||||
if (hasExplicitReturn) {
|
if (hasExplicitReturn) {
|
||||||
const resolvedResult = isPromise(result) ? await result : result
|
const resolvedResult = isPromise(result) ? await result : result
|
||||||
if (resolvedResult !== undefined) {
|
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()) {
|
if (formatted.trim()) {
|
||||||
responseText += `[return value] ${formatted}\n`
|
responseText += `[return value] ${formatted}\n`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user