How to use the egg-mock.consoleLevel 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 alibaba / beidou / examples / benchmark / benchmark.js View on Github external
'use strict';

const Benchmark = require('benchmark');
const mm = require('egg-mock');
const table = require('markdown-table');

mm.consoleLevel('NONE');
// Benchmark.options.minSamples = 100;
let app = null;

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('/');
};

const stopApp = () => app && app.close();