From 2c2ef3a4e27fe579f15da52b6ed817c9fc070f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Dudfield?= Date: Wed, 11 May 2022 11:57:46 +0200 Subject: [PATCH] frontend: Add coverage testing to make test and CI The coverage percentages in package.json that the testing needs to meet are the current levels. --- frontend/Makefile | 2 +- frontend/package.json | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/Makefile b/frontend/Makefile index ca34f79ae..e0c12a1f3 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -21,7 +21,7 @@ build: install .PHONY: test test: - npm run test + npm run test -- --coverage .PHONY: lint lint: diff --git a/frontend/package.json b/frontend/package.json index 39a0999e8..fa272d00f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -133,5 +133,24 @@ } ] }, - "prettier": "@kinvolk/eslint-config/prettier-config" + "prettier": "@kinvolk/eslint-config/prettier-config", + "jest": { + "collectCoverageFrom": [ + "src/**/*.{js,jsx,ts,tsx}", + "!/node_modules/", + "!/build/", + "!src/**/*.stories*.{js,jsx,ts,tsx}" + ], + "coverageThreshold": { + "global": { + "statements": 34.95, + "branches": 26.29, + "functions": 30.35, + "lines": 35.3 + } + }, + "coverageReporters": [ + "text" + ] + } }