Skip to content

Commit dfb079a

Browse files
authored
Always show a summary after Jest tests (#3440)
... because it is otherwise impossible to see what failed.
1 parent 858155e commit dfb079a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

jest.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,19 @@ const config: Config = {
2323
collectCoverageFrom: ["<rootDir>/src/**/*.{js,ts}"],
2424
coverageReporters: ["text-summary", "lcov"],
2525
testResultsProcessor: "@casualbot/jest-sonar-reporter",
26+
27+
// Always print out a summary if there are any failing tests. Normally
28+
// a summary is only printed if there are more than 20 test *suites*.
29+
reporters: [["default", { summaryThreshold: 0 }]],
2630
};
2731

2832
// if we're running under GHA, enable the GHA reporter
2933
if (env["GITHUB_ACTIONS"] !== undefined) {
30-
const reporters: Config["reporters"] = [["github-actions", { silent: false }], "summary"];
34+
const reporters: Config["reporters"] = [
35+
["github-actions", { silent: false }],
36+
// as above: always show a summary if there were any failing tests.
37+
["summary", { summaryThreshold: 0 }],
38+
];
3139

3240
// if we're running against the develop branch, also enable the slow test reporter
3341
if (env["GITHUB_REF"] == "refs/heads/develop") {

0 commit comments

Comments
 (0)