Allow duplicate categories in the same validation step
A single SARIF file should be allowed to have duplicated categories.
This commit is contained in:
parent
8454e21c9c
commit
ab1f709732
6 changed files with 23 additions and 4 deletions
4
lib/upload-lib.test.js
generated
4
lib/upload-lib.test.js
generated
|
|
@ -184,8 +184,10 @@ ava_1.default.beforeEach(() => {
|
|||
(0, ava_1.default)("validateUniqueCategory for multiple runs", (t) => {
|
||||
const sarif1 = createMockSarif("abc", "def");
|
||||
const sarif2 = createMockSarif("ghi", "jkl");
|
||||
const multiSarif = { runs: [sarif1.runs[0], sarif2.runs[0]] };
|
||||
// duplicate categories are allowed within the same sarif file
|
||||
const multiSarif = { runs: [sarif1.runs[0], sarif1.runs[0], sarif2.runs[0]] };
|
||||
t.notThrows(() => uploadLib.validateUniqueCategory(multiSarif));
|
||||
// should throw if there are duplicate categories in separate validations
|
||||
t.throws(() => uploadLib.validateUniqueCategory(sarif1));
|
||||
t.throws(() => uploadLib.validateUniqueCategory(sarif2));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue