Skip to content

Commit 2808880

Browse files
committed
Update log expectation in "app-dir static/dynamic handling" test
1 parent a8bf119 commit 2808880

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

test/e2e/app-dir/app-static/app-static.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,8 +2237,9 @@ describe('app-dir static/dynamic handling', () => {
22372237

22382238
let prevHtml = await res.text()
22392239
let prev$ = cheerio.load(prevHtml)
2240+
const cliOutputLength = next.cliOutput.length
22402241

2241-
await check(async () => {
2242+
await retry(async () => {
22422243
const curRes = await next.fetch('/force-cache')
22432244
expect(curRes.status).toBe(200)
22442245

@@ -2258,14 +2259,18 @@ describe('app-dir static/dynamic handling', () => {
22582259
expect(cur$('#data-auto-cache').text()).toBe(
22592260
prev$('#data-auto-cache').text()
22602261
)
2262+
})
22612263

2262-
return 'success'
2263-
}, 'success')
2264+
if (isNextDev) {
2265+
await retry(() => {
2266+
const cliOutput = next.cliOutput
2267+
.slice(cliOutputLength)
2268+
.replace(/in \d+ms/g, 'in 0ms') // stub request durations
22642269

2265-
if (!isNextDeploy) {
2266-
expect(next.cliOutput).toContain(
2267-
'fetch for https://next-data-api-endpoint.vercel.app/api/random?d4 on /force-cache specified "cache: force-cache" and "revalidate: 3", only one should be specified.'
2268-
)
2270+
expect(stripAnsi(cliOutput)).toContain(`
2271+
│ GET https://next-data-api-en../api/random?d4 200 in 0ms (cache hit)
2272+
│ │ ⚠ Specified "cache: force-cache" and "revalidate: 3", only one should be specified.`)
2273+
})
22692274
}
22702275
})
22712276

0 commit comments

Comments
 (0)