Unverified Commit c175c24d authored by Sebastian Silbermann's avatar Sebastian Silbermann Committed by GitHub

Print Redbox content if `assertNoRedbox` fails (#67973)

parent bfbd9719
...@@ -854,7 +854,18 @@ export async function assertNoRedbox(browser: BrowserInterface) { ...@@ -854,7 +854,18 @@ export async function assertNoRedbox(browser: BrowserInterface) {
}) })
if (hasRedbox) { if (hasRedbox) {
const error = new Error('Expected no Redbox but found one') const [redboxHeader, redboxDescription, redboxSource] = await Promise.all([
getRedboxHeader(browser).catch(() => '<missing>'),
getRedboxDescription(browser).catch(() => '<missing>'),
getRedboxSource(browser).catch(() => '<missing>'),
])
const error = new Error(
'Expected no Redbox but found one\n' +
`header: ${redboxHeader}\n` +
`description: ${redboxDescription}\n` +
`source: ${redboxSource}`
)
Error.captureStackTrace(error, assertHasRedbox) Error.captureStackTrace(error, assertHasRedbox)
throw error throw error
} }
......
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