Skip to content

Commit 3242894

Browse files
Slashgearpieh
andauthored
chore(unit): fix re-add jest-silent-reporter to unit test CI output (gatsbyjs#24071)
* chore(unit): fix jest report by generating default reporters * ⚠️ to remove, example of failing test with report * ignore lint * reuse jest reporters config from jest.config.js * we weren't tracking coverage anyway * forcing failing assertion * fixup purposely failing test Co-authored-by: Michal Piechowiak <[email protected]>
1 parent e58e1ff commit 3242894

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

.circleci/config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ aliases:
6767
- <<: *attach_to_bootstrap
6868
- run: yarn list react
6969
- run:
70-
command: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci --reporters=jest-junit
70+
command: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
7171
environment:
72+
GENERATE_JEST_REPORT: true
7273
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
7374
JEST_JUNIT_OUTPUT_NAME: results.xml
7475
- store_test_results:

jest.config.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,11 @@ module.exports = {
4040
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
4141
},
4242
snapshotSerializers: [`jest-serializer-path`],
43-
collectCoverage: useCoverage,
44-
coverageReporters: [`json-summary`, `text`, `html`, `cobertura`],
45-
coverageThreshold: {
46-
global: {
47-
lines: 45,
48-
statements: 44,
49-
functions: 42,
50-
branches: 43,
51-
},
52-
},
5343
collectCoverageFrom: coverageDirs,
5444
reporters: process.env.CI
55-
? [[`jest-silent-reporter`, { useDots: true }]]
45+
? [[`jest-silent-reporter`, { useDots: true }]].concat(
46+
useCoverage ? `jest-junit` : []
47+
)
5648
: [`default`].concat(useCoverage ? `jest-junit` : []),
5749
testEnvironment: `jest-environment-jsdom-fourteen`,
5850
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],

0 commit comments

Comments
 (0)