Skip to content

Commit 649c41c

Browse files
Fix predicate test fallback for missing scan
The predicate test assumed a scan was already available in the test environment. When no scan was present, it would fail before running the assertions. This change adds a fallback path to fetch a known scan and its result list, ensuring the test remains stable even when the environment starts empty.
1 parent 60de4a8 commit 649c41c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/tests/PredicateTest.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ describe("Triage cases", () => {
2323
}
2424
}
2525
}
26+
if (!scan) {
27+
const scanShow = await auth.scanShow("d4354650-4ee1-4e10-9b1d-0feaf6c187a7");
28+
scan = scanShow?.payload?.pop();
29+
output = await auth.getResultsList(scan.id);
30+
result = output?.payload?.find(res => res.type === CxConstants.SAST);
31+
}
2632
return { scan, result };
2733
};
2834

0 commit comments

Comments
 (0)