Skip to content

Commit 2d1bdb3

Browse files
committed
Add junit report
1 parent fdb3e66 commit 2d1bdb3

4 files changed

Lines changed: 99 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
uses: codecov/codecov-action@v4
4747
with:
4848
token: ${{ secrets.CODECOV_TOKEN }}
49+
- name: Upload test results to Codecov
50+
if: matrix.node-version == '22.x' && ${{ !cancelled() }}
51+
uses: codecov/test-results-action@v1
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
4954

5055
# --- Test on the Bun runtime ---
5156
test-bun:

.mocharc.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"loader": "ts-node/esm",
3-
"extensions": ["ts"],
4-
"spec": ["test/*.ts"],
5-
"timeout": "4000ms"
3+
"extensions": [
4+
"ts"
5+
],
6+
"spec": [
7+
"test/*.ts"
8+
],
9+
"timeout": "4000ms",
10+
"reporter": "mocha-junit-reporter",
11+
"reporter-option": [
12+
"mochaFile=./test-report.junit.xml"
13+
]
614
}

package-lock.json

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"chai": "^5.2.1",
3434
"coveralls": "^3.1.1",
3535
"mocha": "^11.7.1",
36+
"mocha-junit-reporter": "^2.2.1",
3637
"mocha-lcov-reporter": "^1.3.0",
3738
"terser": "^5.43.1",
3839
"ts-node": "^10.9.2",
@@ -41,8 +42,8 @@
4142
"scripts": {
4243
"build": "tsc && terser dist/index.js -o dist/index.js -c -m",
4344
"dev": "tsc -w",
44-
"test": "mocha",
45-
"coverage": "c8 --reporter=text --reporter=lcovonly npm test"
45+
"test": "mocha --reporter mocha-junit-reporter",
46+
"coverage": "c8 --reporter=text --reporter=lcov npm test"
4647
},
4748
"runkitExampleFilename": "sample.js",
4849
"engines": {

0 commit comments

Comments
 (0)