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

Function startApiServer

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

Source from the content-addressed store, hash-verified

20let apiServer
21
22const startApiServer = async (optEnv = {}, opts?: any) => {
23 const scriptPath = join(appDir, 'api-server.js')
24 apiServerPort = await findPort()
25 const env = Object.assign(
26 { ...process.env },
27 { PORT: `${apiServerPort}` },
28 optEnv
29 )
30
31 apiServer = await initNextServerScript(
32 scriptPath,
33 /ready on/i,
34 env,
35 /ReferenceError: options is not defined/,
36 opts
37 )
38}
39
40function runTests() {
41 it('includes polyfilled fetch when using getStaticProps', async () => {

Callers 1

index.test.tsFile · 0.70

Calls 4

joinFunction · 0.90
findPortFunction · 0.90
initNextServerScriptFunction · 0.90
assignMethod · 0.80

Tested by

no test coverage detected