Skip to content

Commit

Permalink
chore: Move test for streaming and RSC (#34724)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Feb 23, 2022
1 parent 33d9615 commit 586616c
Showing 1 changed file with 11 additions and 11 deletions.
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

0 comments on commit 586616c

Please sign in to comment.