Unverified Commit 586616c4 authored by Shu Ding's avatar Shu Ding Committed by GitHub

chore: Move test for streaming and RSC (#34724)

parent 33d96151
...@@ -69,16 +69,7 @@ export default function Page500() { ...@@ -69,16 +69,7 @@ export default function Page500() {
} }
` `
describe('Edge runtime - basic', () => { describe('Edge runtime - errors', () => {
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)
})
it('should warn user that native node APIs are not supported', async () => { it('should warn user that native node APIs are not supported', async () => {
const fsImportedErrorMessage = const fsImportedErrorMessage =
'Native Node.js APIs are not supported in the Edge Runtime. Found `dns` imported.' 'Native Node.js APIs are not supported in the Edge Runtime. Found `dns` imported.'
...@@ -93,7 +84,8 @@ describe('Edge runtime - prod', () => { ...@@ -93,7 +84,8 @@ describe('Edge runtime - prod', () => {
beforeAll(async () => { beforeAll(async () => {
error500Page.write(page500) error500Page.write(page500)
context.appPort = await findPort() 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) context.server = await nextStart(context.appDir, context.appPort)
}) })
afterAll(async () => { afterAll(async () => {
...@@ -101,6 +93,14 @@ describe('Edge runtime - prod', () => { ...@@ -101,6 +93,14 @@ describe('Edge runtime - prod', () => {
await killApp(context.server) 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 () => { it('should generate middleware SSR manifests for edge runtime', async () => {
const distServerDir = join(distDir, 'server') const distServerDir = join(distDir, 'server')
const files = [ const files = [
......
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