Unverified Commit f44b1bf3 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

test: keep HMR trace payloads JSON-encoded

Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent de2dac30
...@@ -387,8 +387,10 @@ export class Playwright<TCurrent = undefined> { ...@@ -387,8 +387,10 @@ export class Playwright<TCurrent = undefined> {
page page
// Note that passing the payload as a an argument is 2 orders of magnitude more expensive in Playwright. // Note that passing the payload as a an argument is 2 orders of magnitude more expensive in Playwright.
// Instead, serialize the whole message into a string literal expression so that // Instead, serialize the whole message into a string literal expression so that
// any quotes or backslashes in the payload are escaped. // any quotes or backslashes in the JSON-encoded payload are escaped.
.evaluate(JSON.stringify(`received ws message ${text}`)) .evaluate(
JSON.stringify(`received ws message ${JSON.stringify(text)}`)
)
.catch(() => {}) .catch(() => {})
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment