From 8487f22b8ed19e17e9d004759bad4f2b290a22e4 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 17 Jul 2018 14:09:00 -0600 Subject: [PATCH] feat: added test results --- .circleci/config.yml | 11 +++++++++-- package-lock.json | 35 +++++++++++++++++++++++++++++++++++ package.json | 21 +++++++++++---------- scripts/test.js | 6 +++++- 4 files changed, 60 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92a18e11c..dd98d8c41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,6 @@ # job_environment will setup the environment for any job being executed. job_environment: &job_environment NODE_ENV: test - CI: true # job_defaults applies all the defaults for each job. job_defaults: &job_defaults @@ -53,6 +52,10 @@ jobs: # unit_tests will run the unit tests. unit_tests: <<: *job_defaults + environment: + <<: *job_environment + CI: true + JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" steps: - checkout - attach_workspace: @@ -64,7 +67,11 @@ jobs: name: Perform testing # We're running these tests in band to avoid errors where the circleci # test runner runs out of RAM trying to run them all in parallel. - command: npm run test -- --runInBand + command: npm run test -- --ci --runInBand --testResultsProcessor="jest-junit" + - store_test_results: + path: reports/junit + - store_artifacts: + path: reports/junit # build will build the static assets and server typescript files. build: diff --git a/package-lock.json b/package-lock.json index db8d3ddbc..271d5e135 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12486,6 +12486,35 @@ "pretty-format": "^23.2.0" } }, + "jest-junit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-5.1.0.tgz", + "integrity": "sha512-3EVf1puv2ox5wybQDfLX3AEn3IKOgDV4E76y4pO2hBu46DEtAFZZAm//X1pzPQpqKji0zqgMIzqzF/K+uGAX9A==", + "dev": true, + "requires": { + "jest-validate": "^23.0.1", + "mkdirp": "^0.5.1", + "strip-ansi": "^4.0.0", + "xml": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "jest-leak-detector": { "version": "23.2.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz", @@ -23340,6 +23369,12 @@ "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", "dev": true }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true + }, "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", diff --git a/package.json b/package.json index b6a18e136..5f709a7e1 100644 --- a/package.json +++ b/package.json @@ -71,8 +71,8 @@ "@types/convict": "^4.2.0", "@types/cross-spawn": "^6.0.0", "@types/dotenv": "^4.0.3", - "@types/enzyme-adapter-react-16": "^1.0.2", "@types/enzyme": "^3.1.11", + "@types/enzyme-adapter-react-16": "^1.0.2", "@types/express": "^4.16.0", "@types/graphql": "^0.13.3", "@types/ioredis": "^3.2.12", @@ -84,10 +84,10 @@ "@types/luxon": "^0.5.3", "@types/mongodb": "^3.1.1", "@types/node": "^10.5.2", + "@types/passport": "^0.4.5", "@types/passport-local": "^1.0.33", "@types/passport-oauth2": "^1.4.5", "@types/passport-strategy": "^0.2.33", - "@types/passport": "^0.4.5", "@types/query-string": "^6.1.0", "@types/react-dom": "^16.0.6", "@types/react-relay": "github:coralproject/patched#types/react-relay", @@ -113,20 +113,21 @@ "cross-spawn": "^6.0.5", "css-loader": "^0.28.11", "docz": "^0.5.8", + "enzyme": "^3.3.0", "enzyme-adapter-react-16": "^1.1.1", "enzyme-to-json": "^3.3.4", - "enzyme": "^3.3.0", "extract-text-webpack-plugin": "^4.0.0-beta.0", "final-form": "^4.8.1", "flat": "^4.1.0", + "fluent": "^0.6.4", "fluent-intl-polyfill": "^0.1.0", "fluent-langneg": "^0.1.0", "fluent-react": "^0.7.0", - "fluent": "^0.6.4", "graphql-playground-middleware-express": "^1.7.2", "graphql-schema-typescript": "^1.2.1", "html-webpack-plugin": "^3.2.0", "jest": "^23.4.1", + "jest-junit": "^5.1.0", "jsdom": "^11.11.0", "loader-utils": "^1.1.0", "npm-run-all": "^4.1.3", @@ -143,6 +144,7 @@ "pstree.remy": "^1.1.0", "query-string": "^6.1.0", "raw-loader": "^0.5.1", + "react": "^16.4.0", "react-dev-utils": "6.0.0-next.3e165448", "react-dom": "^16.4.0", "react-final-form": "^3.6.4", @@ -150,10 +152,9 @@ "react-responsive": "^4.1.0", "react-test-renderer": "^16.4.1", "react-timeago": "^4.1.9", - "react": "^16.4.0", "recompose": "^0.27.1", - "relay-compiler-language-typescript": "github:coralproject/patched#relay-compiler-language-typescript", "relay-compiler": "github:coralproject/patched#relay-compiler", + "relay-compiler-language-typescript": "github:coralproject/patched#relay-compiler-language-typescript", "relay-local-schema": "^0.7.0", "relay-runtime": "github:coralproject/patched#relay-runtime", "relay-test-utils": "github:coralproject/patched#relay-test-utils", @@ -163,20 +164,20 @@ "ts-jest": "^23.0.0", "ts-loader": "^4.4.2", "ts-node": "^6.2.0", - "tsconfig-paths-webpack-plugin": "^3.1.4", "tsconfig-paths": "^3.4.2", + "tsconfig-paths-webpack-plugin": "^3.1.4", + "tslint": "^5.10.0", "tslint-config-prettier": "^1.13.0", "tslint-loader": "^3.6.0", "tslint-plugin-prettier": "^1.3.0", "tslint-react": "^3.6.0", - "tslint": "^5.10.0", "typed-css-modules": "^0.3.4", "typescript": "^2.9.2", "uglifyjs-webpack-plugin": "^1.2.5", + "webpack": "4.12.0", "webpack-cli": "^3.0.2", "webpack-dev-server": "^3.1.4", "webpack-hot-client": "^4.1.1", - "webpack-manifest-plugin": "^2.0.3", - "webpack": "4.12.0" + "webpack-manifest-plugin": "^2.0.3" } } diff --git a/scripts/test.js b/scripts/test.js index f08b18de6..59c8a93cc 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -22,7 +22,11 @@ let argv = process.argv.slice(2); argv.push("--config", paths.appJestConfig); // Watch unless on CI or in coverage mode -if (!process.env.CI && argv.indexOf("--coverage") < 0) { +if ( + !process.env.CI && // ensure that the ci env var is not set. + argv.indexOf("--ci") < 0 && // ensure that the ci flag is not passed + argv.indexOf("--coverage") < 0 // ensure that the coverage flag is not passed +) { argv.push("--watch"); }