diff --git a/.circleci/config.yml b/.circleci/config.yml index 74d29f76..70ee714f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,7 +92,12 @@ jobs: steps: - attach_workspace: at: ~/prettier - - run: yarn test:dist + - run: + command: yarn test:dist + environment: + REPORT_SUMMARIES: 1 + - store_test_results: + path: test-results # Run tests using the standalone build test_prod_standalone: diff --git a/.gitignore b/.gitignore index e2a52608..32a9d006 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ coverage .idea package-lock.json +/test-results diff --git a/jest.config.js b/jest.config.js index 32c86ae2..2351c2b5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -39,5 +39,16 @@ module.exports = { watchPlugins: [ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" - ] + ], + reporters: process.env.REPORT_SUMMARIES + ? [ + "default", + [ + "jest-junit", + { + output: "./test-results/jest/junit.xml" + } + ] + ] + : undefined }; diff --git a/package.json b/package.json index 7c0e1fb5..270e7419 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "eslint-plugin-react": "7.7.0", "execa": "0.10.0", "jest": "23.3.0", + "jest-junit": "5.0.0", "jest-watch-typeahead": "0.1.0", "mkdirp": "0.5.1", "prettier": "1.13.7", diff --git a/scripts/build/build.js b/scripts/build/build.js index d1543c8c..d2c3596f 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -80,6 +80,7 @@ async function preparePackage() { pkg.engines.node = ">=4"; delete pkg.dependencies; delete pkg.devDependencies; + delete pkg["jest-junit"]; pkg.scripts = { prepublishOnly: "node -e \"assert.equal(require('.').version, require('..').version)\"" diff --git a/yarn.lock b/yarn.lock index dab428ca..f4bab793 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3339,6 +3339,15 @@ jest-jasmine2@^23.3.0: jest-util "^23.3.0" pretty-format "^23.2.0" +jest-junit@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-5.0.0.tgz#30ed3317c325165c2458ed2649f09d6e214ffab8" + dependencies: + jest-validate "^23.0.1" + mkdirp "^0.5.1" + strip-ansi "^4.0.0" + xml "^1.0.1" + jest-leak-detector@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz#c289d961dc638f14357d4ef96e0431ecc1aa377d" @@ -3463,6 +3472,15 @@ jest-util@^23.3.0: slash "^1.0.0" source-map "^0.6.0" +jest-validate@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.0.1.tgz#cd9f01a89d26bb885f12a8667715e9c865a5754f" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.0.1" + jest-validate@^23.3.0: version "23.3.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.3.0.tgz#d49bea6aad98c30acd2cbb542434798a0cc13f76" @@ -4485,7 +4503,14 @@ prettier@1.13.7: version "1.13.7" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" -pretty-format@^23.0.1, pretty-format@^23.2.0: +pretty-format@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.0.1.tgz#d61d065268e4c759083bccbca27a01ad7c7601f4" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +pretty-format@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" dependencies: @@ -5963,6 +5988,10 @@ xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" +xml@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + xtend@^4.0.0, xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"