()
| 210 | } |
| 211 | |
| 212 | async stop(): Promise<void> { |
| 213 | if (!this.handle) return; |
| 214 | const child = this.handle.child; |
| 215 | this.handle = null; |
| 216 | |
| 217 | await new Promise<void>(resolve => { |
| 218 | try { |
| 219 | child.once('close', () => resolve()); |
| 220 | terminateChildProcess(child); |
| 221 | } catch { |
| 222 | resolve(); |
| 223 | } |
| 224 | setTimeout(() => resolve(), 1500); |
| 225 | }); |
| 226 | } |
| 227 | |
| 228 | async restart(options: { timeoutMs: number } = { timeoutMs: 60_000 }): Promise<DevServerHandle> { |
| 229 | await this.stop(); |
no test coverage detected