| 19 | const nextConfig = new File(join(appDir, 'next.config.js')) |
| 20 | let app |
| 21 | const 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 | |
| 41 | describe('config-output-export', () => { |
| 42 | afterEach(async () => { |