Skip to content

Commit f53826c

Browse files
author
Dave Bartolomeo
committed
Better dependency version assertions
1 parent b16aeb3 commit f53826c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-manager.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,17 @@ describe("Variant Analysis Manager", () => {
404404

405405
// Assume the first dependency to check is the core library.
406406
if (dependenciesToCheck.length > 0) {
407-
expect(
408-
qlpackContents.dependencies?.[dependenciesToCheck[0]],
409-
).not.toEqual("${workspace}");
407+
const dependencyVersion =
408+
qlpackContents.dependencies?.[dependenciesToCheck[0]];
409+
410+
// There should be a version specified.
411+
expect(dependencyVersion).toBeDefined();
412+
413+
// Any `${workspace}` placeholder should have been replaced.
414+
// The actual version might be `*` (for the legacy code path where we replace workspace
415+
// references with `*`) or a specific version (for the new code path where the CLI does all
416+
// the work).
417+
expect(dependencyVersion).not.toEqual("${workspace}");
410418
}
411419
const qlpackLockContents = load(
412420
packFS.fileContents("codeql-pack.lock.yml").toString("utf-8"),

0 commit comments

Comments
 (0)