Skip to content

Commit

Permalink
Tech: mesure la couverture des tests unitaires
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnix committed Sep 11, 2020
1 parent cce1cd0 commit ab1379e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
src/index.html
package-lock.json
.cache
.nyc_output
__pycache__
feedback/paper_key
contenus/zoverride
16 changes: 16 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"reporter": [
"text",
"text-summary"
],
"include": [
"src/scripts/**/*.js"
],
"exclude": [
"src/scripts/tests/**/*.js"
],
"require": [
],
"check-coverage": false,
"cache": true
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ script_flags =
endif

test-unit: ## Run JS unit tests.
npm run-script test $(script_flags)
npm run-script test:coverage $(script_flags)

test-integration: build ## Run JS browser tests.
ifdef browser
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"jsdom": "^16.2.2",
"mocha": "^8.0.1",
"node-static": "^0.7.11",
"nyc": "^15.1.0",
"parcel-bundler": "^1.12.4",
"parcel-plugin-html-externals": "^0.2.0",
"parcel-plugin-ogimage": "^1.2.0",
Expand All @@ -26,6 +27,7 @@
},
"scripts": {
"test": "mocha --require @babel/register src/scripts/tests/",
"test:coverage": "nyc npm run test",
"test-integration": "mocha --require @babel/register --bail --timeout 10000 src/scripts/tests/integration/",
"lint": "eslint src/scripts/ src/service-worker.js",
"prebuild": "rm -rf dist",
Expand Down

0 comments on commit ab1379e

Please sign in to comment.