MCPcopy
hub / github.com/vercel/next.js / startServer

Function startServer

test/integration/custom-server/test/index.test.ts:38–56  ·  view source on GitHub ↗
(optEnv = {}, opts?: any)

Source from the content-addressed store, hash-verified

36 : undefined
37
38 const startServer = async (optEnv = {}, opts?: any) => {
39 const scriptPath = join(appDir, 'server.js')
40 context.appPort = appPort = await getPort()
41 nextUrl = `http${useHttps ? 's' : ''}://localhost:${context.appPort}`
42
43 const env = Object.assign(
44 { ...process.env },
45 { PORT: `${appPort}`, __NEXT_TEST_MODE: 'true', USE_HTTPS: useHttps },
46 optEnv
47 )
48
49 server = await initNextServerScript(
50 scriptPath,
51 /ready on/i,
52 env,
53 /ReferenceError: options is not defined/,
54 opts
55 )
56 }
57
58 describe('with dynamic assetPrefix', () => {
59 beforeAll(() => startServer())

Callers 1

index.test.tsFile · 0.70

Calls 3

joinFunction · 0.90
initNextServerScriptFunction · 0.90
assignMethod · 0.80

Tested by

no test coverage detected