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

Function devStartAndExport

test/integration/repeated-slashes/test/index.test.ts:414–463  ·  view source on GitHub ↗
(isPages404)

Source from the content-addressed store, hash-verified

412
413describe('404 handling', () => {
414 const devStartAndExport = (isPages404) => {
415 describe('next dev', () => {
416 beforeAll(async () => {
417 appPort = await findPort()
418 app = await launchApp(appDir, appPort)
419
420 // prebuild pages
421 await renderViaHTTP(appPort, '/')
422 await renderViaHTTP(appPort, '/another')
423 })
424 afterAll(() => killApp(app))
425
426 runTests({
427 isPages404,
428 isDev: true,
429 })
430 })
431 ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
432 'production mode',
433 () => {
434 describe('next start', () => {
435 beforeAll(async () => {
436 await nextBuild(appDir)
437 appPort = await findPort()
438 app = await nextStart(appDir, appPort)
439 })
440 afterAll(() => killApp(app))
441 runTests({
442 isPages404,
443 })
444 })
445 describe('next export', () => {
446 beforeAll(async () => {
447 nextConfig.write(`module.exports = { output: 'export' }`)
448 await nextBuild(appDir)
449 app = await startStaticServer(outdir, join(outdir, '404.html'))
450 appPort = app.address().port
451 })
452 afterAll(async () => {
453 await stopApp(app)
454 nextConfig.restore()
455 })
456 runTests({
457 isPages404,
458 isExport: true,
459 })
460 })
461 }
462 )
463 }
464
465 describe('custom _error', () => {
466 devStartAndExport(false)

Callers 1

index.test.tsFile · 0.85

Calls 14

findPortFunction · 0.90
launchAppFunction · 0.90
renderViaHTTPFunction · 0.90
killAppFunction · 0.90
nextBuildFunction · 0.90
nextStartFunction · 0.90
startStaticServerFunction · 0.90
joinFunction · 0.90
stopAppFunction · 0.90
describeFunction · 0.85
addressMethod · 0.80
runTestsFunction · 0.70

Tested by

no test coverage detected