Add test for existing automationDetails
This commit is contained in:
parent
0ece0d074b
commit
351d36fd18
3 changed files with 18 additions and 3 deletions
|
|
@ -133,7 +133,7 @@ test("finding SARIF files", async (t) => {
|
|||
});
|
||||
|
||||
test("populateRunAutomationDetails", (t) => {
|
||||
const sarif = '{"runs": [{}]}';
|
||||
let sarif = '{"runs": [{}]}';
|
||||
const analysisKey = ".github/workflows/codeql-analysis.yml:analyze";
|
||||
|
||||
let expectedSarif =
|
||||
|
|
@ -163,4 +163,14 @@ test("populateRunAutomationDetails", (t) => {
|
|||
"{}"
|
||||
);
|
||||
t.deepEqual(modifiedSarif, expectedSarif);
|
||||
|
||||
// check that an empty environment produces the right results
|
||||
sarif = '{"runs":[{"automationDetails":{"id":"my_id"}}]}';
|
||||
expectedSarif = '{"runs":[{"automationDetails":{"id":"my_id"}}]}';
|
||||
modifiedSarif = uploadLib.populateRunAutomationDetails(
|
||||
sarif,
|
||||
analysisKey,
|
||||
'{"os": "linux", "language": "javascript"}'
|
||||
);
|
||||
t.deepEqual(modifiedSarif, expectedSarif);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue