Add an integration test for packaging

Uses two pre-existing packages to run some simple queries on a javascript
database.
This commit is contained in:
Andrew Eisenberg 2021-06-08 10:24:08 -07:00
parent 1cc5f1d5dd
commit d42f654f7a
8 changed files with 78 additions and 9 deletions

View file

@ -799,7 +799,10 @@ function getCodeQLForCmd(cmd: string): CodeQL {
const parsedOutput: PackDownloadOutput = JSON.parse(output);
if (
Array.isArray(parsedOutput.packs) &&
parsedOutput.packs.every((p) => p.name && p.version)
// TODO PackDownloadOutput will not include the version if it is not specified
// in the input. The version is always the latest version available.
// It should be added to the output, but this requires a CLI change
parsedOutput.packs.every((p) => p.name /* && p.version */)
) {
return parsedOutput;
} else {

View file

@ -20,7 +20,7 @@ test("ensure lines of code works for cpp and js", async (t) => {
t.deepEqual(results, {
cpp: 6,
javascript: 3,
javascript: 9,
});
});
@ -34,7 +34,7 @@ test("ensure lines of code can handle undefined language", async (t) => {
);
t.deepEqual(results, {
javascript: 3,
javascript: 9,
python: 5,
});
});
@ -93,6 +93,6 @@ test("ensure lines of code can handle exclude", async (t) => {
);
t.deepEqual(results, {
javascript: 3,
javascript: 9,
});
});