From e14b1248d500db97ecdde4384fc45f78b0d7583d Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Wed, 17 Aug 2022 10:55:55 +0200 Subject: [PATCH] ci: add cobertura coverage report --- .gitlab-ci.yml | 9 ++++++--- package.json | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b8a6843..6af1197b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ cache: - node_modules before_script: - - npm install + - npm ci stages: - build @@ -27,9 +27,12 @@ test: stage: test script: - npm test + coverage: '/Statements[^:]*\:[^:]*\s+([\d\.]+)%/' artifacts: - paths: - - coverage + reports: + coverage_report: + coverage_format: cobertura + path: coverage/cobertura-coverage.xml audit: stage: test diff --git a/package.json b/package.json index d132b526..b1271d77 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prepublishOnly": "npm ci && npm run build", "preversion": "npm run prepublishOnly", "push": "git push && git push origin \"v$npm_package_version\"", - "test": "nyc mocha --require source-map-support/register --require ts-node/register 'test/**/*.spec.ts'", + "test": "nyc mocha 'test/**/*.spec.ts'", "lint": "eslint --ext .ts src/" }, "author": "Karl-Philipp Wulfert ", @@ -83,6 +83,7 @@ "lines": 95, "per-file": true, "reporter": [ + "cobertura", "html", "text-summary" ],