Skip to content

Commit 48c841b

Browse files
committed
Setting up jest-junit
1 parent fc2d818 commit 48c841b

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
dist
22
node_modules
33

4-
# Jest test coverage results directory
4+
# Jest test results directories
55
coverage
6+
reports
67
# Storybook build directory
78
storybook-static
89
# Prefer npm to yarn

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const config: Config = {
110110
// projects: undefined,
111111

112112
// Use this configuration option to add custom reporters to Jest
113-
// reporters: undefined,
113+
reporters: ["default", "jest-junit"],
114114

115115
// Automatically reset mock state before every test
116116
// resetMocks: false,

package-lock.json

Lines changed: 43 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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"identity-obj-proxy": "^3.0.0",
4848
"jest": "^29.6.2",
4949
"jest-environment-jsdom": "^29.6.2",
50+
"jest-junit": "^16.0.0",
5051
"luxon": "^3.3.0",
5152
"prop-types": "^15.8.1",
5253
"react": "^18.2.0",
@@ -60,5 +61,14 @@
6061
"ts-node": "^10.9.1",
6162
"tslib": "^2.6.0",
6263
"typescript": "^5.1.6"
64+
},
65+
"jest-junit": {
66+
"outputDirectory": "reports",
67+
"outputName": "jest-junit.xml",
68+
"ancestorSeparator": " > ",
69+
"uniqueOutputName": "false",
70+
"suiteNameTemplate": "{filepath}",
71+
"classNameTemplate": "{classname}",
72+
"titleTemplate": "{title}"
6373
}
6474
}

0 commit comments

Comments
 (0)