Skip to content

Commit 7f6ccff

Browse files
committed
Add coverage and codecov
1 parent 8b5635e commit 7f6ccff

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

.github/.codecov.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
informational: true

.github/workflows/ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ jobs:
2222
npm run compile
2323
- name: Tests
2424
run: |
25-
npm test
25+
npm run coverage
26+
- name: Publish to Codecov
27+
uses: codecov/codecov-action@v2
28+
with:
29+
files: coverage/lcov.info

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ node_modules
66
lib/
77
.eslintcache
88
docs
9+
10+
# coverage
11+
.nyc_output
12+
coverage

package.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"main": "lib/bigdecimal.js",
1010
"module": "lib/bigdecimal.mjs",
1111
"scripts": {
12-
"test": "mocha -t 100000 test/**/**/*.js",
12+
"test": "mocha --require ts-node/register --require source-map-support/register -t 100000 test/**/**/*.js",
13+
"coverage": "nyc --reporter=lcov npm run test",
1314
"compile": " npm run compile:cjs && npm run compile:esm && npm run prepareESM",
1415
"compile:esm": "tsc --module es2020 --outDir lib/esm",
1516
"compile:cjs": "tsc --module commonjs --outDir lib",
@@ -65,8 +66,23 @@
6566
"chai": "~4.3",
6667
"eslint": "~7.28.0",
6768
"mocha": "~9.0.0",
69+
"nyc": "^15.1.0",
6870
"rimraf": "~3.0.2",
71+
"source-map-support": "^0.5.19",
72+
"ts-node": "^10.2.1",
6973
"typedoc": "~0.20.36",
7074
"typescript": "~4.2.4"
75+
},
76+
"nyc": {
77+
"extension": [
78+
".ts"
79+
],
80+
"exclude": [
81+
"**/*.d.ts"
82+
],
83+
"reporter": [
84+
"html"
85+
],
86+
"all": true
7187
}
7288
}

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"stripInternal": true,
55
"declaration": true,
66
// "outDir": "lib",
7-
"sourceMap": false,
7+
"sourceMap": true,
88
/* Basic Options */
99
// "incremental": true, /* Enable incremental compilation */
1010
"target": "es2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */

0 commit comments

Comments
 (0)