How to use the egg-mock.app function in egg-mock

To help you get started, we’ve selected a few egg-mock examples, based on popular ways it is used in public projects.

github midwayjs / midway / packages / midway-mock / src / mock.ts View on Github external
mm.app = (options): MidwayMockApplication => {
  if (process.env.MIDWAY_BASE_DIR && !options.baseDir) { options.baseDir = process.env.MIDWAY_BASE_DIR; }
  if (process.env.MIDWAY_FRAMEWORK_PATH && !options.framework) { options.framework = process.env.MIDWAY_FRAMEWORK_PATH; }
  // @ts-ignore
  return mock.app(Object.assign({
    framework: options.framework || defaultFramework,
    typescript: !!require.extensions['.ts'],
  }, options));
};
github eggjs / egg / test / utils.js View on Github external
exports.app = (name, options) => {
  options = formatOptions(name, options);
  const app = mm.app(options);
  return app;
};
github alibaba / beidou / examples / benchmark / benchmark.js View on Github external
const startApp = async () => {
  process.env.NODE_ENV = 'production';
  mm.env('prod');
  app = mm.app({
    baseDir: __dirname,
    framework: 'beidou',
  });
  await app.ready();
  await app.httpRequest().get('/');
};

egg-mock

mock server for egg

MIT
Latest version published 4 months ago

Package Health Score

67 / 100
Full package analysis

Similar packages