From f2cb318a09c5367eeff391749a1c2b75d7a804c3 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Wed, 17 Aug 2022 16:35:14 +0200 Subject: [PATCH] ci: add cobertura coverage report --- .gitlab-ci.yml | 6 ++++++ package.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 727d0e25..aa4fd085 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,6 +52,12 @@ unit: stage: test script: - npm test + coverage: '/Statements[^:]*\:[^:]*\s+([\d\.]+)%/' + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage/cobertura-coverage.xml pages: stage: deploy diff --git a/package.json b/package.json index d1791fd3..dc6c98f1 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,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 ts-node/register --recursive 'test/*.spec.ts'", + "test": "nyc mocha --recursive 'test/*.spec.ts'", "lint": "eslint --ext .ts src/" }, "description": "Node.js library to interact with the StApps backend service", @@ -113,6 +113,7 @@ "lines": 95, "per-file": true, "reporter": [ + "cobertura", "html", "text-summary" ],