Unverified Commit 98e61efe authored by Janka Uryga's avatar Janka Uryga Committed by GitHub

test: log html output for a flaky test to debug it (#78424)

this test has been flaky recently but we don't know why and can't repro
locally. this PR adds a log to inspect the full HTML when it fails

x-ref: https://vercel.slack.com/archives/C05KYT5S9FF/p1745259844464719
parent 79b34f06
......@@ -94,7 +94,19 @@ describe('app dir - rsc basics', () => {
it('should correctly render page returning undefined', async () => {
const homeHTML = await next.render('/return-undefined/page')
const $ = cheerio.load(homeHTML)
expect(stripHTMLComments($('#return-undefined-layout').html())).toBeEmpty()
try {
expect(
stripHTMLComments($('#return-undefined-layout').html())
).toBeEmpty()
} catch (err) {
const sep = '='.repeat(40) + ' PAGE HTML ' + '='.repeat(40)
console.log()
console.log(sep)
console.log($('html').html())
console.log(sep)
console.log()
throw err
}
})
it('should correctly render component returning undefined', async () => {
......
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