We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30c1281 commit b1343fcCopy full SHA for b1343fc
projects/npm-tools/packages/jest-junit-reporter/src/index.js
@@ -37,18 +37,25 @@ module.exports = (report) => {
37
};
38
39
const testResults = report.testResults
40
- .reduce(
41
- (results, suite) =>
42
- suite.testResults.length
43
- ? results.concat(
44
- suite.testResults.map((test) => ({
45
- ...test,
46
- testFilePath: suite.testFilePath,
47
- }))
48
- )
49
- : results,
50
- []
51
+ .reduce((results, suite) => {
+ if (suite.testResults.length) {
+ results.concat(
+ suite.testResults.map((test) => ({
+ ...test,
+ testFilePath: suite.testFilePath,
+ }))
+ );
+ } else if (suite.failureMessage) {
+ results.push({
+ duration: 0,
+ failureMessages: [suite.failureMessage],
52
+ fullName: suite.testFilePath,
53
54
+ });
55
+ }
56
+
57
+ return results;
58
+ }, [])
59
.map((testCase) => {
60
const results = [
61
{
0 commit comments