Skip to content

Commit 2c713f9

Browse files
committed
ci: generate junit report
1 parent 4fc58b3 commit 2c713f9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pids
1616

1717
# Directory for instrumented libs generated by jscoverage/JSCover
1818
lib-cov
19+
test-report.junit.xml
1920

2021
# Coverage directory used by tools like istanbul
2122
coverage
@@ -64,6 +65,7 @@ typings/
6465
yarn-error.log
6566
.pnp/
6667
.pnp.js
68+
6769
# Yarn Integrity file
6870
.yarn-integrity
6971

vitest.config.mts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { defineConfig } from 'vitest/config';
1+
import { defineConfig, configDefaults } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
55
include: ['**/tests/**/*.test.ts'],
66
setupFiles: ['./vitest.setup.mts'],
7+
clearMocks: true,
78
coverage: {
89
include: ['lib/**'],
910
thresholds: {
@@ -13,5 +14,10 @@ export default defineConfig({
1314
statements: 90,
1415
},
1516
},
17+
// Enable JUnit reporter in CI environment
18+
reporters: process.env.CI ? ['default', 'junit'] : configDefaults.reporters,
19+
outputFile: {
20+
junit: 'test-report.junit.xml',
21+
},
1622
},
1723
});

0 commit comments

Comments
 (0)