Skip to content

Commit 5e0c960

Browse files
committed
feat: enable code coverage
Fixes #613 Hitting mocha timeout creates false coverage reports, that leads to `c8` reporting false statistics.
1 parent e0f8851 commit 5e0c960

File tree

7 files changed

+513
-18
lines changed

7 files changed

+513
-18
lines changed

.github/workflows/main.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,31 @@ jobs:
2525
uses: GabrielBB/xvfb-action@v1
2626
with:
2727
run: npm test
28+
29+
coverage:
30+
strategy:
31+
matrix:
32+
os: [ubuntu-latest]
33+
node-version: [18.x]
34+
fail-fast: false
35+
runs-on: ${{ matrix.os }}
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
43+
- name: Installing Extension
44+
run: npm ci
45+
46+
- name: Coverage report
47+
uses: GabrielBB/xvfb-action@v1
48+
with:
49+
run: npm run coverage
50+
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v3
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
fail_ci_if_error: true

.nycrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"all": true,
3+
"include": ["out/**/*.js"],
4+
"exclude": ["**/node_modules/**", "out/test/**"],
5+
"reporter": ["html", "text", "lcov"]
6+
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
node_modules
44
.vscode-test
5+
coverage
56
dist
67
out

coverconfig.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)