From bfca3710da7492cfb0430d1da8370af55fbaa226 Mon Sep 17 00:00:00 2001 From: Oleksandr Mazepa Date: Thu, 21 Nov 2024 18:06:51 +0200 Subject: [PATCH] other: Add tests coverage thresholds --- .gitignore | 1 + .nycrc.json | 9 +++++++++ package.json | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .nycrc.json diff --git a/.gitignore b/.gitignore index e7c5e576..2c2f785c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build ./test.js .coverage/ .nvmrc +.DS_Store diff --git a/.nycrc.json b/.nycrc.json new file mode 100644 index 00000000..1997bf73 --- /dev/null +++ b/.nycrc.json @@ -0,0 +1,9 @@ +{ + "check-coverage": true, + "reporter":"lcov", + "report-dir":".coverage", + "branches": 80, + "functions": 80, + "lines": 80, + "statements": 80 +} diff --git a/package.json b/package.json index cadf7b4e..8e09b8fb 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "build:release": "webpack --config ./webpack/webpack.release.config.js --progress --color && npm run build:prepublish", "build:prepublish": "node ./SetupPackage.js", "start": "webpack --watch --config ./webpack/webpack.dev.config.js --progress --color", - "test": "multi='dot=- xunit=./results.xml' nyc --reporter=text-summary --reporter=lcov --report-dir=.coverage mocha -t 10000 -R mocha-multi -r ts-node/register test/*.test.ts", - "test:debug": "multi='dot=- xunit=./results.xml' nyc --reporter=text-summary --reporter=lcov --report-dir=.coverage mocha --inspect-brk -t 10000 -R mocha-multi -r ts-node/register test/*.test.ts", + "test": "multi='dot=- xunit=./results.xml' nyc mocha -t 10000 -R mocha-multi -r ts-node/register test/*.test.ts", + "test:debug": "multi='dot=- mocha --inspect-brk -t 10000 -R mocha-multi -r ts-node/register test/*.test.ts", "test:watch": "mocha -r ts-node/register -w -R dot test/*.test.ts", "docs": "typedoc --tsconfig ./tsconfig.json --plugin typedoc-plugin-markdown", "lint": "eslint . --ext .ts",