Add tests

This commit is contained in:
Michael B. Gale
2025-09-20 14:06:20 +01:00
parent d14a2122fd
commit c7eb488f8f
2 changed files with 126 additions and 0 deletions

View File

@@ -271,6 +271,42 @@ test(
},
);
test(
calculateAugmentationMacro,
"With repo property queries",
undefined,
undefined,
[KnownLanguage.javascript],
{
"github-codeql-extra-queries": "a, b, c, d",
},
{
...dbConfig.defaultAugmentationProperties,
repoPropertyQueries: {
combines: false,
input: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
},
},
);
test(
calculateAugmentationMacro,
"With repo property queries combining",
undefined,
undefined,
[KnownLanguage.javascript],
{
"github-codeql-extra-queries": "+ a, b, c, d",
},
{
...dbConfig.defaultAugmentationProperties,
repoPropertyQueries: {
combines: true,
input: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
},
},
);
const calculateAugmentationErrorMacro = test.macro({
exec: async (
t: ExecutionContext,
@@ -315,6 +351,18 @@ test(
/The workflow property "packs" is invalid/,
);
test(
calculateAugmentationErrorMacro,
"Plus (+) with nothing else (repo property queries)",
undefined,
undefined,
[KnownLanguage.javascript],
{
"github-codeql-extra-queries": " + ",
},
/The repository property "github-codeql-extra-queries" is invalid/,
);
test(
calculateAugmentationErrorMacro,
"Packs input with multiple languages",