How to use the egg-mock.cluster 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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github midwayjs / midway / packages / midway-mock / src / mock.ts View on Github external
mm.cluster = (options) => {
  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.cluster(Object.assign({
    framework: options.framework || defaultFramework,
    typescript: !!require.extensions['.ts'],
  }, options));
};
github eggjs / egg / test / utils.js View on Github external
exports.cluster = (name, options) => {
  options = formatOptions(name, options);
  return mm.cluster(options);
};