diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c0c598b52366..cb131fede1d98 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,5 @@ orbs: win: circleci/windows@2.4.0 - slack: circleci/slack@3.4.1 executors: node: @@ -99,6 +98,7 @@ aliases: GENERATE_JEST_REPORT: "true" JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/ JEST_JUNIT_OUTPUT_NAME: results.xml + JEST_JUNIT_REPORT_TEST_SUITE_ERRORS: "true" - store_test_results: path: ./test-results/jest-node/ @@ -522,7 +522,7 @@ jobs: yarn - run: name: Run tests - command: yarn jest --ci --runInBand ((yarn jest --listTests) | Foreach-Object {$_ -replace '.*\\packages', 'packages'} | Foreach-Object {$_ -replace '\\', '/'} | circleci tests split --split-by=timings) + command: yarn jest --ci --runInBand ((yarn jest --listTests) | Foreach-Object {$_ -replace '.*\\packages', 'packages'} | Foreach-Object {$_ -replace '\\', '/'} | circleci tests split) no_output_timeout: 15m environment: NODE_OPTIONS: --max-old-space-size=2048 @@ -530,6 +530,7 @@ jobs: COMPILER_OPTIONS: GATSBY_MAJOR=5 JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/ JEST_JUNIT_OUTPUT_NAME: results.xml + JEST_JUNIT_REPORT_TEST_SUITE_ERRORS: "true" - store_test_results: path: ./test-results/jest-node/ diff --git a/jest.config.js b/jest.config.js index 872ed9f01cb7f..50cc1556baf43 100644 --- a/jest.config.js +++ b/jest.config.js @@ -18,7 +18,7 @@ const ignoreDirs = [`/packages/gatsby-dev-cli/verdaccio`].concat( ) const coverageDirs = pkgs.map(p => path.join(p, `src/**/*.js`)) -const useCoverage = !!process.env.GENERATE_JEST_REPORT +const useJestUnit = !!process.env.GENERATE_JEST_REPORT // list to add ESM to ignore const esModules = [ @@ -145,9 +145,9 @@ module.exports = { collectCoverageFrom: coverageDirs, reporters: process.env.CI ? [[`jest-silent-reporter`, { useDots: true, showPaths: true }]].concat( - useCoverage ? `jest-junit` : [] + useJestUnit ? `jest-junit` : [] ) - : [`default`].concat(useCoverage ? `jest-junit` : []), + : [`default`].concat(useJestUnit ? `jest-junit` : []), moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`], setupFiles: [`/.jestSetup.js`], setupFilesAfterEnv: [`jest-extended`],