Skip to content

Commit

Permalink
fix: add results check
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Apr 17, 2021
1 parent a6b8b7c commit caecd15
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions core/instrument/src/misc/jest-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,23 @@ export const extractTests = async (
...options,
},
);
Object.keys(testResults.coverage).forEach(covFile => {
const componentKey = files.coverageFiles[`.${path.sep}${covFile}`];
if (componentKey) {
results[componentKey].coverage[covFile] =
testResults.coverage[covFile];
}
});
testResults.results.forEach(r => {
const componentKey = files.testFiles[`.${path.sep}${r.testFilePath}`];
if (componentKey) {
results[componentKey].results.push(r);
}
});
if (testResults.coverage) {
Object.keys(testResults.coverage).forEach(covFile => {
const componentKey = files.coverageFiles[`.${path.sep}${covFile}`];
if (componentKey) {
results[componentKey].coverage[covFile] =
testResults.coverage[covFile];
}
});
}
if (testResults.results) {
testResults.results.forEach(r => {
const componentKey = files.testFiles[`.${path.sep}${r.testFilePath}`];
if (componentKey) {
results[componentKey].results.push(r);
}
});
}
}
}
return results;
Expand Down

0 comments on commit caecd15

Please sign in to comment.