Skip to content

Commit

Permalink
ci: add jest-junit (jestjs#6322)
Browse files Browse the repository at this point in the history
* ci: add jest-junit

* syntax?

* I don't know how to yaml

* specify test result dir
  • Loading branch information
SimenB authored May 29, 2018
1 parent e5ed1a5 commit 86c91d5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
38 changes: 32 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn lint && yarn typecheck && yarn lint-es5-build && yarn lint:md:ci
- run: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn typecheck && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:md:ci
- store_test_results:
path: reports/junit

test-browser:
working_directory: ~/jest
Expand All @@ -64,7 +66,12 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn test-ci-partial
- run:
command: yarn test-ci-partial
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit

test-node-9:
working_directory: ~/jest
Expand All @@ -75,7 +82,11 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn test-ci-partial
- run:
command: yarn test-ci-partial
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"


test-jest-circus:
working_directory: ~/jest
Expand All @@ -86,7 +97,12 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: JEST_CIRCUS=1 yarn test-ci-partial
- run:
command: JEST_CIRCUS=1 yarn test-ci-partial
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit

test-node-8:
working_directory: ~/jest
Expand All @@ -97,7 +113,12 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn test-ci
- run:
command: yarn test-ci
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit

test-node-6:
working_directory: ~/jest
Expand All @@ -108,7 +129,12 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn test-ci-partial
- run:
command: yarn test-ci-partial
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit

test-and-deploy-website:
working_directory: ~/jest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ lerna-debug.log
npm-debug.log
npm-debug.log*
yarn-error.log*
junit.xml
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"istanbul-api": "^1.3.1",
"istanbul-lib-coverage": "^1.0.0",
"jasmine-reporters": "^2.2.0",
"jest-junit": "^4.0.0",
"jest-silent-reporter": "^0.0.5",
"jquery": "^3.2.1",
"karma": "^2.0.0",
Expand Down Expand Up @@ -88,8 +89,8 @@
"postinstall": "yarn build",
"publish": "yarn build-clean && yarn build && lerna publish --silent",
"test-ci-es5-build-in-browser": "karma start --single-run",
"test-ci": "yarn jest-coverage -i --reporters jest-silent-reporter && yarn test-leak && node scripts/mapCoverage.js && codecov",
"test-ci-partial": "yarn jest -i --reporters jest-silent-reporter",
"test-ci": "yarn jest-coverage -i --reporters jest-silent-reporter --testResultsProcessor=jest-junit && yarn test-leak && node scripts/mapCoverage.js && codecov",
"test-ci-partial": "yarn jest -i --reporters jest-silent-reporter --testResultsProcessor=jest-junit",
"test-pretty-format-perf": "node packages/pretty-format/perf/test.js",
"test-leak": "yarn jest -i --detectLeaks jest-mock jest-diff jest-repl",
"test": "yarn typecheck && yarn lint && yarn jest",
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5291,6 +5291,14 @@ jest-jasmine2@^22.4.4:
jest-util "^22.4.1"
source-map-support "^0.5.0"

jest-junit@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-4.0.0.tgz#6af04d43940d7e81dc7d37ec1b80c97551d91e80"
dependencies:
mkdirp "^0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.1"

jest-matcher-utils@^22.4.0, jest-matcher-utils@^22.4.3:
version "22.4.3"
resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-22.4.3.tgz#4632fe428ebc73ebc194d3c7b65d37b161f710ff"
Expand Down

0 comments on commit 86c91d5

Please sign in to comment.