Skip to content

Commit

Permalink
chore(unit): fix re-add jest-silent-reporter to unit test CI output (
Browse files Browse the repository at this point in the history
…#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 <misiek.piechowiak@gmail.com>
  • Loading branch information
Slashgear and pieh authored May 15, 2020
1 parent e58e1ff commit 3242894
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ aliases:
- <<: *attach_to_bootstrap
- run: yarn list react
- run:
command: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci --reporters=jest-junit
command: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci
environment:
GENERATE_JEST_REPORT: true
JEST_JUNIT_OUTPUT_DIR: ./test-results/jest-node/
JEST_JUNIT_OUTPUT_NAME: results.xml
- store_test_results:
Expand Down
14 changes: 3 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,11 @@ module.exports = {
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
},
snapshotSerializers: [`jest-serializer-path`],
collectCoverage: useCoverage,
coverageReporters: [`json-summary`, `text`, `html`, `cobertura`],
coverageThreshold: {
global: {
lines: 45,
statements: 44,
functions: 42,
branches: 43,
},
},
collectCoverageFrom: coverageDirs,
reporters: process.env.CI
? [[`jest-silent-reporter`, { useDots: true }]]
? [[`jest-silent-reporter`, { useDots: true }]].concat(
useCoverage ? `jest-junit` : []
)
: [`default`].concat(useCoverage ? `jest-junit` : []),
testEnvironment: `jest-environment-jsdom-fourteen`,
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
Expand Down

0 comments on commit 3242894

Please sign in to comment.