From ddf732fba211b2123da568bbb1ee6d84d046c083 Mon Sep 17 00:00:00 2001 From: Solais <924615994@qq.com> Date: Tue, 18 Apr 2023 16:06:35 +0800 Subject: [PATCH] feat: append cobertura to support diff line coverage (#227) Co-authored-by: zhixiang.tzx --- src/cmd/cov.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cmd/cov.ts b/src/cmd/cov.ts index ff6622d5..ccdf023d 100644 --- a/src/cmd/cov.ts +++ b/src/cmd/cov.ts @@ -26,7 +26,7 @@ export class CovCommand extends TestCommand { @Option({ description: 'c8 instruments passthrough`', - default: '--temp-directory node_modules/.c8_output -r text-summary -r json-summary -r json -r lcov', + default: '--temp-directory node_modules/.c8_output -r text-summary -r json-summary -r json -r lcov -r cobertura', }) c8: string; @@ -51,6 +51,10 @@ export class CovCommand extends TestCommand { if (this.prerequire) { this.ctx.env.EGG_BIN_PREREQUIRE = 'true'; } + // append cobertura + if (this.c8) { + this.c8 += ' -r cobertura'; + } // add c8 args // https://github.com/eggjs/egg/issues/3930