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

Function startApp

test/lib/next-test-utils.ts:675–691  ·  view source on GitHub ↗
(app: NextServer)

Source from the content-addressed store, hash-verified

673}
674
675export async function startApp(app: NextServer) {
676 // force require usage instead of dynamic import in jest
677 // x-ref: https://github.com/nodejs/node/issues/35889
678 process.env.__NEXT_TEST_MODE = 'jest'
679
680 // TODO: tests that use this should be migrated to use
681 // the nextStart test function instead as it tests outside
682 // of jest's context
683 await app.prepare()
684 const handler = app.getRequestHandler()
685 const server = http.createServer(handler)
686 server['__app'] = app
687
688 await startListen(server)
689
690 return server
691}
692
693export async function stopApp(server: http.Server | undefined) {
694 if (!server) {

Callers 11

index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90

Calls 4

startListenFunction · 0.85
createServerMethod · 0.80
prepareMethod · 0.65
getRequestHandlerMethod · 0.65

Tested by

no test coverage detected