Skip to content

Commit 1004e44

Browse files
committed
ci: better unit testing report for ci
1 parent d47f6a2 commit 1004e44

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

.circleci/config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ jobs:
2121
node -v
2222
- run: npm install
2323
- run: npm run lint
24-
- run: npm run test:prod
24+
- run:
25+
name: "Testing"
26+
command: npm run test:ci
27+
environment:
28+
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
29+
- store_test_results:
30+
path: reports/junit
31+
- store_artifacts:
32+
path: reports/junit
2533
- run: npm run build
2634
deploy:
2735
docker:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ docs
1010
compiled
1111
.awcache
1212
.rpt2_cache
13+
junit.xml

package-lock.json

Lines changed: 34 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
"start": "rollup -c rollup.config.ts -w",
3939
"test": "jest",
4040
"test:watch": "jest --watch",
41-
"test:prod": "npm run lint && npm run test -- --coverage --no-cache --ci --forceExit",
41+
"test:ci": "npm run test -- --coverage --no-cache --ci --forceExit --testResultsProcessor=\"jest-junit\"",
4242
"deploy-docs": "ts-node tools/gh-pages-publish",
4343
"report-coverage": "cat ./coverage/lcov.info | coveralls",
4444
"commit": "git-cz",
4545
"semantic-release": "semantic-release",
4646
"precommit": "lint-staged",
4747
"docker": "docker build -t etcd . && docker run -d -p 2379:2379 -p 2380:2380 etcd",
4848
"travis-deploy-once": "travis-deploy-once",
49-
"prepush": "npm run test:prod && npm run build",
49+
"prepush": "npm run test:ci && npm run build",
5050
"commitmsg": "validate-commit-msg"
5151
},
5252
"lint-staged": {
@@ -104,6 +104,7 @@
104104
"express-session": "^1.15.6",
105105
"husky": "^0.14.0",
106106
"jest": "^22.0.2",
107+
"jest-junit": "^3.6.0",
107108
"lint-staged": "^7.0.0",
108109
"lodash.camelcase": "^4.3.0",
109110
"prettier": "^1.4.4",

0 commit comments

Comments
 (0)