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

chore: Move test for streaming and RSC #34724

Merged
merged 1 commit into from Feb 23, 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
Expand Up @@ -69,16 +69,7 @@ export default function Page500() {
}
`

describe('Edge runtime - basic', () => {
it('should warn user for experimental risk with server components', async () => {
const edgeRuntimeWarning =
'You are using the experimental Edge Runtime with `experimental.runtime`.'
const rscWarning = `You have experimental React Server Components enabled. Continue at your own risk.`
const { stderr } = await nextBuild(appDir)
expect(stderr).toContain(edgeRuntimeWarning)
expect(stderr).toContain(rscWarning)
})

describe('Edge runtime - errors', () => {
it('should warn user that native node APIs are not supported', async () => {
const fsImportedErrorMessage =
'Native Node.js APIs are not supported in the Edge Runtime. Found `dns` imported.'
Expand All @@ -93,14 +84,23 @@ describe('Edge runtime - prod', () => {
beforeAll(async () => {
error500Page.write(page500)
context.appPort = await findPort()
await nextBuild(context.appDir)
const { stderr } = await nextBuild(context.appDir)
context.stderr = stderr
context.server = await nextStart(context.appDir, context.appPort)
})
afterAll(async () => {
error500Page.delete()
await killApp(context.server)
})

it('should warn user for experimental risk with edge runtime and server components', async () => {
const edgeRuntimeWarning =
'You are using the experimental Edge Runtime with `experimental.runtime`.'
const rscWarning = `You have experimental React Server Components enabled. Continue at your own risk.`
expect(context.stderr).toContain(edgeRuntimeWarning)
expect(context.stderr).toContain(rscWarning)
})

it('should generate middleware SSR manifests for edge runtime', async () => {
const distServerDir = join(distDir, 'server')
const files = [
Expand Down