(baseDir: string, options: StartEggOptions = {})
| 60 | * @return {App} app - Application object. |
| 61 | */ |
| 62 | export async function singleProcessApp(baseDir: string, options: StartEggOptions = {}): Promise<SingleModeApplication> { |
| 63 | if (!baseDir.startsWith('/')) { |
| 64 | baseDir = path.join(__dirname, 'fixtures', baseDir); |
| 65 | } |
| 66 | options.env = options.env || 'unittest'; |
| 67 | options.baseDir = baseDir; |
| 68 | const app = await startEgg(options); |
| 69 | Reflect.set(app, 'httpRequest', () => request(app.callback())); |
| 70 | return app as unknown as SingleModeApplication; |
| 71 | } |
| 72 | |
| 73 | let localServer: http.Server | undefined; |
| 74 | process.once('beforeExit', () => { |
no test coverage detected
searching dependent graphs…