Add test for modified findSarifFilesInDir
This commit is contained in:
parent
f7fbaa019f
commit
51891595a7
6 changed files with 34 additions and 10 deletions
8
lib/upload-lib.test.js
generated
8
lib/upload-lib.test.js
generated
|
|
@ -91,6 +91,9 @@ ava_1.default.beforeEach(() => {
|
|||
fs.mkdirSync(path.join(tmpDir, "dir3"));
|
||||
fs.symlinkSync(tmpDir, path.join(tmpDir, "dir3", "symlink1"), "dir");
|
||||
fs.symlinkSync(path.join(tmpDir, "a.sarif"), path.join(tmpDir, "dir3", "symlink2.sarif"), "file");
|
||||
// add some `.quality.sarif` files that should be ignored, unless we look for them specifically
|
||||
fs.writeFileSync(path.join(tmpDir, "a.quality.sarif"), "");
|
||||
fs.writeFileSync(path.join(tmpDir, "dir1", "b.quality.sarif"), "");
|
||||
const sarifFiles = uploadLib.findSarifFilesInDir(tmpDir);
|
||||
t.deepEqual(sarifFiles, [
|
||||
path.join(tmpDir, "a.sarif"),
|
||||
|
|
@ -98,6 +101,11 @@ ava_1.default.beforeEach(() => {
|
|||
path.join(tmpDir, "dir1", "d.sarif"),
|
||||
path.join(tmpDir, "dir1", "dir2", "e.sarif"),
|
||||
]);
|
||||
const qualitySarifFiles = uploadLib.findSarifFilesInDir(tmpDir, uploadLib.qualityIsSarif);
|
||||
t.deepEqual(qualitySarifFiles, [
|
||||
path.join(tmpDir, "a.quality.sarif"),
|
||||
path.join(tmpDir, "dir1", "b.quality.sarif"),
|
||||
]);
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("populateRunAutomationDetails", (t) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue