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

Function runDev

test/integration/config-output-export/test/index.test.ts:21–39  ·  view source on GitHub ↗
(config: any, shouldWaitForReady = true)

Source from the content-addressed store, hash-verified

19const nextConfig = new File(join(appDir, 'next.config.js'))
20let app
21const runDev = async (config: any, shouldWaitForReady = true) => {
22 await nextConfig.write(`module.exports = ${JSON.stringify(config)}`)
23 const port = await findPort()
24 const obj = { port, stdout: '', stderr: '' }
25 app = await launchApp(appDir, port, {
26 stdout: false,
27 onStdout(msg: string) {
28 obj.stdout += msg || ''
29 },
30 stderr: false,
31 onStderr(msg: string) {
32 obj.stderr += msg || ''
33 },
34 })
35 if (shouldWaitForReady) {
36 await fetch(`http://localhost:${port}`)
37 }
38 return obj
39}
40
41describe('config-output-export', () => {
42 afterEach(async () => {

Callers 1

index.test.tsFile · 0.85

Calls 5

findPortFunction · 0.90
launchAppFunction · 0.90
fetchFunction · 0.50
writeMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected