Skip to content

Commit f4d56b2

Browse files
committed
docs(testing): add info on test coverage
testing: increase timeout to 7000ms for rare occasion goes over 5000 testing: require `check-coverage` and set branches/lines/statements to 95% until `exportParser.js` coverage may be added
1 parent ffecc96 commit f4d56b2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ See ESLint's [RuleTester](https://eslint.org/docs/developer-guide/nodejs-api#rul
4343
for more on the allowable properties (e.g., `code`, `errors` (for invalid rules),
4444
`options`, `settings`, etc.).
4545

46+
Note that besides `npm test`, there is `npm run test-cov` which shows more detailed
47+
information on coverage. Coverage should be maintained at 100%, and if there are
48+
a few guards in place for future use, the code block in question can be ignored
49+
by being preceded by `/* istanbul ignore next */`.
50+
4651
## Requirements for PRs
4752

4853
PRs should be mergeable, [rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps",
6565
"create-readme": "gitdown ./.README/README.md --output-file ./README.md && npm run add-assertions",
6666
"lint": "eslint ./src ./test",
67-
"test-cov": "BABEL_ENV=test nyc mocha --recursive --require @babel/register --reporter progress --timeout 5000",
68-
"test": "BABEL_ENV=test nyc --reporter text-summary mocha --recursive --require @babel/register --reporter progress --timeout 5000"
67+
"test-cov": "BABEL_ENV=test nyc mocha --recursive --require @babel/register --reporter progress --timeout 7000",
68+
"test": "BABEL_ENV=test nyc --reporter text-summary mocha --recursive --require @babel/register --reporter progress --timeout 7000"
6969
},
7070
"nyc": {
7171
"require": [
@@ -75,7 +75,12 @@
7575
"instrument": false,
7676
"include": [
7777
"src/"
78-
]
78+
],
79+
"check-coverage": true,
80+
"branches": 95,
81+
"lines": 95,
82+
"functions": 100,
83+
"statements": 95
7984
},
8085
"version": "1.0.0"
8186
}

0 commit comments

Comments
 (0)