Skip to content

Commit 9d2190a

Browse files
author
Dave Bartolomeo
committed
Add text if pack is empty
1 parent 6d308f8 commit 9d2190a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function toExistInPack(
4141
}
4242

4343
const pass = packFS.fileExists(actual);
44-
const files = packFS.allFiles().join("\n");
44+
const files = packFS.allFiles();
45+
const filesString = files.length > 0 ? files.join("\n") : "<none>";
4546
if (pass) {
4647
return {
4748
pass: true,
@@ -51,7 +52,7 @@ function toExistInPack(
5152
return {
5253
pass: false,
5354
message: () =>
54-
`expected ${actual} to exist in pack. The following files were found in the pack:\n${files}`,
55+
`expected ${actual} to exist in pack.\nThe following files were found in the pack:\n${filesString}`,
5556
};
5657
}
5758
}

0 commit comments

Comments
 (0)