Fix for empty TRX TestDefinitions

This commit is contained in:
Oles Galatsan 2025-05-15 15:40:14 +03:00
parent d609194929
commit 2acf6c2ccd
2 changed files with 4 additions and 2 deletions

3
dist/index.js generated vendored
View file

@ -937,7 +937,8 @@ class DotnetTrxParser {
} }
} }
getTestClasses(trx) { getTestClasses(trx) {
if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined) { if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined ||
!trx.TestRun.TestDefinitions.some(td => td.UnitTest && Array.isArray(td.UnitTest))) {
return []; return [];
} }
const unitTests = {}; const unitTests = {};

View file

@ -62,7 +62,8 @@ export class DotnetTrxParser implements TestParser {
} }
private getTestClasses(trx: TrxReport): TestClass[] { private getTestClasses(trx: TrxReport): TestClass[] {
if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined) { if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined ||
!trx.TestRun.TestDefinitions.some(td => td.UnitTest && Array.isArray(td.UnitTest))) {
return [] return []
} }