Skip to content

Commit df24804

Browse files
committed
Adds jest junit reporting
1 parent d3db577 commit df24804

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ jobs:
1414
- name: Install modules
1515
run: npm i
1616
- name: Run tests
17-
run: npm run test
17+
run: npm run test:ci
18+
- name: Reports the results of tests
19+
uses: IgnusG/jest-report-action@v{ current version }
20+
if: always() # Or use "continue-on-error: true" in previous test step
21+
with:
22+
access-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
node_modules
33
package-lock.json
4+
junit.xml

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"test": "tests"
99
},
1010
"scripts": {
11-
"test": "node --experimental-vm-modules node_modules/.bin/jest"
11+
"test": "node --experimental-vm-modules node_modules/.bin/jest",
12+
"test:ci": "npm run test -- --ci --reporters=default --reporters=jest-junit"
1213
},
1314
"repository": {
1415
"type": "git",
@@ -25,9 +26,15 @@
2526
"node": ">=15.11.0"
2627
},
2728
"dependencies": {
28-
"jest": "^26.6.3"
29+
"jest": "^26.6.3",
30+
"jest-junit": "^12.0.0"
2931
},
3032
"jest": {
3133
"transform": {}
34+
},
35+
"jest-junit": {
36+
"suiteNameTemplate": "{filepath}",
37+
"classNameTemplate": "{classname}",
38+
"titleTemplate": "{title}"
3239
}
3340
}

0 commit comments

Comments
 (0)