Merge pull request #7505 from backjo/fix/Jacoco
fix: add check for existence of lines in jacoco converter
This commit is contained in:
@@ -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 = {
|
||||
$: {
|
||||
|
||||
Reference in New Issue
Block a user