Skip to content

Commit b644cf3

Browse files
committed
add junit test report
1 parent 7499e41 commit b644cf3

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ jobs:
3939
- name: Report Coverage
4040
if: (!cancelled())
4141
uses: davelosert/vitest-coverage-report-action@v2
42+
43+
- name: Publish JUnit Test Report
44+
if: (!cancelled()) && (success() || failure())
45+
uses: mikepenz/action-junit-report@v5
46+
with:
47+
report_paths: reports/junit.xml
48+
check_name: 'Vitest JUnit'
49+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ tmp
33
dist
44
.vscode
55
coverage
6+
reports
67

78
/lib
89
output/

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"build": "tsc -p tsconfig.build.json",
1717
"watch": "tsc -w -p tsconfig.build.json",
1818
"prepare": "npm run build",
19-
"clean": "git clean -xdf dist coverage",
20-
"clean:all": "git clean -xdf dist coverage node_modules",
19+
"clean": "git clean -xdf dist coverage reports",
20+
"clean:all": "git clean -xdf dist coverage reports node_modules",
2121
"publish:dry": "npm publish --dry-run",
2222
"test": "vitest",
2323
"test:coverage": "vitest run --coverage"

vitest.config.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export default defineConfig({
88
exclude: [ "**/node_nodules/**", "**/dist/**", "**/examples/**", "**/docs/**" ],
99
globals: true,
1010

11+
typecheck: {
12+
enabled: true,
13+
tsconfig: "./tsconfig.json"
14+
},
15+
1116
coverage: {
1217
provider: "v8",
1318
include: [ "src/**/*.ts" ],
@@ -16,9 +21,9 @@ export default defineConfig({
1621
reportOnFailure: true
1722
},
1823

19-
typecheck: {
20-
enabled: true,
21-
tsconfig: "./tsconfig.json"
22-
}
24+
reporters: [ "default", "junit" ],
25+
outputFile: {
26+
junit: "reports/junit.xml"
27+
},
2328
}
2429
})

0 commit comments

Comments
 (0)