Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize react streaming ISR test #35885

Merged
merged 1 commit into from Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,7 +1,7 @@
/* eslint-env jest */
import webdriver from 'next-webdriver'
import { join } from 'path'
import { findPort, killApp, renderViaHTTP } from 'next-test-utils'
import { check, findPort, killApp, renderViaHTTP } from 'next-test-utils'
import { nextBuild, nextDev, nextStart } from './utils'

const appDir = join(__dirname, '../switchable-runtime')
Expand Down Expand Up @@ -109,11 +109,13 @@ describe('Switchable runtime (prod)', () => {
await new Promise((resolve) => setTimeout(resolve, 4000))
await renderViaHTTP(context.appPort, '/node-rsc-isr')

const html3 = await renderViaHTTP(context.appPort, '/node-rsc-isr')
const renderedAt3 = +html3.match(/Time: (\d+)/)[1]
expect(html3).toContain('Runtime: Node.js')

expect(renderedAt2).toBeLessThan(renderedAt3)
await check(async () => {
const html3 = await renderViaHTTP(context.appPort, '/node-rsc-isr')
const renderedAt3 = +html3.match(/Time: (\d+)/)[1]
return renderedAt2 < renderedAt3
? 'success'
: `${renderedAt2} should be less than ${renderedAt3}`
}, 'success')
})

it('should build /edge as a dynamic page with the edge runtime', async () => {
Expand Down