MCPcopy
hub / github.com/eggjs/egg / singleProcessApp

Function singleProcessApp

test/utils.ts:62–71  ·  view source on GitHub ↗
(baseDir: string, options: StartEggOptions = {})

Source from the content-addressed store, hash-verified

60 * @return {App} app - Application object.
61 */
62export 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
73let localServer: http.Server | undefined;
74process.once('beforeExit', () => {

Callers 3

local.test.tsFile · 0.85
context.test.tsFile · 0.85

Calls 2

startEggFunction · 0.85
requestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…