Skip to content

Commit 4ef39a5

Browse files
committed
output jest unit tests in junit format
1 parent 1caed82 commit 4ef39a5

File tree

4 files changed

+50
-2
lines changed

4 files changed

+50
-2
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ aliases:
2020
command: npm run lint
2121
- &unit
2222
name: "run unit tests"
23-
command: npm run unit
23+
command: JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run unit -- --reporters=jest-junit
2424
- &build
2525
name: "run npm build"
2626
command: |

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ dist/*
1616
# generated translation files
1717
/translations
1818
/locale
19+
20+
# tests
21+
/test/results/*

package-lock.json

+41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"lint": "eslint . --ext .js,.jsx",
1414
"start": "webpack-dev-server",
1515
"test": "npm run lint && npm run unit && NODE_ENV=production npm run build",
16-
"unit": "jest",
16+
"unit": "jest --reporters=default",
1717
"watch": "webpack --progress --colors --watch"
1818
},
1919
"author": "Massachusetts Institute of Technology",
@@ -69,6 +69,7 @@
6969
"html-webpack-plugin": "3.2.0",
7070
"jest": "22.4.4",
7171
"jest-canvas-mock": "2.3.1",
72+
"jest-junit": "13.0.0",
7273
"json": "9.0.6",
7374
"lodash.defaultsdeep": "4.6.1",
7475
"mkdirp": "1.0.4",
@@ -114,6 +115,9 @@
114115
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js"
115116
}
116117
},
118+
"jest-junit": {
119+
"outputDirectory": "./test/results"
120+
},
117121
"browserslist": [
118122
"last 3 versions",
119123
"Safari >= 8",

0 commit comments

Comments
 (0)