Skip to content

Commit 98e61ef

Browse files
authored
test: log html output for a flaky test to debug it (vercel#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
1 parent 79b34f0 commit 98e61ef

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/e2e/app-dir/rsc-basic/rsc-basic.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,19 @@ describe('app dir - rsc basics', () => {
9494
it('should correctly render page returning undefined', async () => {
9595
const homeHTML = await next.render('/return-undefined/page')
9696
const $ = cheerio.load(homeHTML)
97-
expect(stripHTMLComments($('#return-undefined-layout').html())).toBeEmpty()
97+
try {
98+
expect(
99+
stripHTMLComments($('#return-undefined-layout').html())
100+
).toBeEmpty()
101+
} catch (err) {
102+
const sep = '='.repeat(40) + ' PAGE HTML ' + '='.repeat(40)
103+
console.log()
104+
console.log(sep)
105+
console.log($('html').html())
106+
console.log(sep)
107+
console.log()
108+
throw err
109+
}
98110
})
99111

100112
it('should correctly render component returning undefined', async () => {

0 commit comments

Comments
 (0)