@gaoding/ergate-inspector
v1.0.5
Published
ergate code Coverage
Downloads
3
Readme
@gaoding/ergate-inspector
ergate 应用运行时代码覆盖率收集插件
Installation
npm install @gaoding/ergate-inspector
yarn add @gaoding/ergate-inspector
Usage
// app.ts
import '@gaoding/ergate-inspector';
// config.[env].ts
config.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
目录下。