Merge pull request #7505 from backjo/fix/Jacoco

fix: add check for existence of lines in jacoco converter
This commit is contained in:
Fredrik Adelöw
2021-10-08 13:24:19 +02:00
committed by GitHub
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-code-coverage-backend': patch
---
check for existence of lines property in files
@@ -83,7 +83,7 @@ export class Jacoco implements Converter {
private extractLines(sourcefile: JacocoSourceFile): ParsedLine[] {
const parsed: ParsedLine[] = [];
sourcefile.line.forEach(l => {
sourcefile.line?.forEach(l => {
parsed.push({
number: parseInt(l.$.nr, 10),
missed_instructions: parseInt(l.$.mi, 10),
@@ -79,7 +79,7 @@ export type JacocoSourceFile = {
$: {
name: string;
};
line: JacocoLine[];
line: JacocoLine[] | undefined;
};
export type JacocoLine = {
$: {