@gaoding/egg-inspector

1.0.7 • Public • Published

egg-inspector

Egg 应用运行时代码覆盖率收集插件

Install

$ npm i @gaoding/egg-inspector --save

Usage

// {app_root}/config/plugin.js
exports.inspector = {
  enable: true,
  package: '@gaoding/egg-inspector',
};

Configuration

// {app_root}/config/config.default.js
exports.inspector = {
    exclude?: string[];  // file exclude, default: ['internal/**', 'node_modules/**']
    include?: string[];  // file include, default: ['file:**']

    enable?: boolean;    // enable code coverage inspect?, default: true

    reportHtml?: boolean;// convert dump data to html, default: false
};

插件会注册一个中间件到全局,注册接口事件 GET /coverage-dump, 当访问该接口的时候,会输出代码覆盖文件到 ${project}/coverage 目录下。

License

MIT

Package Sidebar

Install

npm i @gaoding/egg-inspector

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

5.73 kB

Total Files

5

Last publish

Collaborators

  • linfanboss
  • gaoding-bot
  • sharkseven
  • facai
  • laoshu133
  • aui
  • mljsgto222
  • xuezi
  • mutou
  • moocher
  • zengtiansheng