mirror of
https://github.com/github/codeql-action.git
synced 2026-05-14 23:30:14 +00:00
Add unit test for diffRangeExtensionPackContents
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
defaultSuites,
|
||||
resolveQuerySuiteAlias,
|
||||
addSarifExtension,
|
||||
diffRangeExtensionPackContents,
|
||||
} from "./analyze";
|
||||
import { createStubCodeQL } from "./codeql";
|
||||
import { Feature } from "./feature-flags";
|
||||
@@ -158,3 +159,19 @@ test("addSarifExtension", (t) => {
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test("diffRangeExtensionPackContents", (t) => {
|
||||
const output = diffRangeExtensionPackContents([
|
||||
{
|
||||
path: "/checkout/path/main.js",
|
||||
startLine: 10,
|
||||
endLine: 20,
|
||||
},
|
||||
]);
|
||||
|
||||
const expected = fs.readFileSync(
|
||||
`${__dirname}/../src/testdata/pr-diff-range.yml`,
|
||||
"utf8",
|
||||
);
|
||||
t.deepEqual(output, expected);
|
||||
});
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/util
|
||||
extensible: restrictAlertsTo
|
||||
checkPresence: false
|
||||
data:
|
||||
- ['/checkout/path/main.js', 10, 20]
|
||||
Reference in New Issue
Block a user