Skip to content

Commit

Permalink
add stdout/stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 8, 2022
1 parent c27f8b2 commit 4b6d276
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Expand Up @@ -53,7 +53,7 @@ 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.'
const { stderr } = await nextBuild(nativeModuleTestAppDir)
const { stderr } = await nextBuild(nativeModuleTestAppDir, { stderr: true })
expect(stderr).toContain(fsImportedErrorMessage)
})
})
Expand Down Expand Up @@ -140,6 +140,7 @@ const edgeRuntimeBasicSuite = {
const nodejsRuntimeBasicSuite = {
runTests: (context, env) => {
const options = { runtime: 'nodejs', env }
const distDir = join(appDir, '.next')
basic(context, options)
streaming(context, options)
rsc(context, options)
Expand Down
Expand Up @@ -3,9 +3,10 @@ import webdriver from 'next-webdriver'
import { renderViaHTTP, check } from 'next-test-utils'
import { join } from 'path'
import fs from 'fs-extra'
import { distDir, getNodeBySelector } from './utils'
import { getNodeBySelector } from './utils'

export default function (context, { runtime, env }) {
const distDir = join(context.appDir, '.next')
it('should render server components correctly', async () => {
const homeHTML = await renderViaHTTP(context.appPort, '/', null, {
headers: {
Expand Down
Expand Up @@ -50,7 +50,10 @@ describe('Switchable runtime (prod)', () => {

beforeAll(async () => {
context.appPort = await findPort()
const { stdout, stderr } = await nextBuild(context.appDir)
const { stdout, stderr } = await nextBuild(context.appDir, {
stderr: true,
stdout: true,
})
context.stdout = stdout
context.stderr = stderr
context.server = await nextStart(context.appDir, context.appPort)
Expand Down

0 comments on commit 4b6d276

Please sign in to comment.