MCPcopy Create free account
hub / github.com/arktypeio/arktype / start

Method start

ark/repo/testNextDev.ts:142–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140 }
141
142 async start() {
143 this.log = ""
144 this.port = await freePort()
145 const child = spawn(
146 process.execPath,
147 [next, "dev", "-p", String(this.port), ...bundlers[this.bundler].flags],
148 {
149 cwd: appDir,
150 detached: process.platform !== "win32",
151 env: { ...process.env, NEXT_TELEMETRY_DISABLED: "1" }
152 }
153 )
154 this.child = child
155 child.stdout!.on("data", data => (this.log += data))
156 child.stderr!.on("data", data => (this.log += data))
157 for (let waited = 0; !this.log.includes("Ready"); waited += 100) {
158 if (waited > 60_000 || child.exitCode !== null) {
159 throw new Error(
160 `${this.bundler}'s dev server didn't start:\n${this.log}`
161 )
162 }
163 await sleep(100)
164 }
165 }
166
167 stop() {
168 if (this.child) killTree(this.child)

Callers 1

testNextDev.tsFile · 0.45

Calls 4

freePortFunction · 0.85
spawnFunction · 0.85
StringInterface · 0.85
sleepFunction · 0.70

Tested by

no test coverage detected