Skip to content

Commit 1120f2f

Browse files
Fix tests
1 parent 2f573ab commit 1120f2f

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

extensions/ql-vscode/test/vscode-tests/cli-integration/packaging.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe("Packaging commands", () => {
1919
const progress = jest.fn();
2020
let quickPickSpy: jest.SpiedFunction<typeof window.showQuickPick>;
2121
let inputBoxSpy: jest.SpiedFunction<typeof window.showInputBox>;
22-
let showAndLogErrorMessageSpy: jest.SpiedFunction<
23-
typeof helpers.showAndLogErrorMessage
22+
let showAndLogExceptionWithTelemetrySpy: jest.SpiedFunction<
23+
typeof helpers.showAndLogExceptionWithTelemetry
2424
>;
2525
let showAndLogInformationMessageSpy: jest.SpiedFunction<
2626
typeof helpers.showAndLogInformationMessage
@@ -33,8 +33,8 @@ describe("Packaging commands", () => {
3333
inputBoxSpy = jest
3434
.spyOn(window, "showInputBox")
3535
.mockResolvedValue(undefined);
36-
showAndLogErrorMessageSpy = jest
37-
.spyOn(helpers, "showAndLogErrorMessage")
36+
showAndLogExceptionWithTelemetrySpy = jest
37+
.spyOn(helpers, "showAndLogExceptionWithTelemetry")
3838
.mockResolvedValue(undefined);
3939
showAndLogInformationMessageSpy = jest
4040
.spyOn(helpers, "showAndLogInformationMessage")
@@ -85,9 +85,10 @@ describe("Packaging commands", () => {
8585

8686
await handleDownloadPacks(cli, progress);
8787

88-
expect(showAndLogErrorMessageSpy).toHaveBeenCalledWith(
89-
expect.stringContaining("Unable to download all packs."),
90-
);
88+
expect(showAndLogExceptionWithTelemetrySpy).toHaveBeenCalled();
89+
expect(
90+
showAndLogExceptionWithTelemetrySpy.mock.calls[0][0].fullMessage,
91+
).toEqual("Unable to download all packs. See log for more details.");
9192
});
9293

9394
it("should install valid workspace pack", async () => {

extensions/ql-vscode/test/vscode-tests/no-workspace/contextual/queryResolver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("queryResolver", () => {
8181
expect(true).toBe(false);
8282
} catch (e) {
8383
expect(getErrorMessage(e)).toBe(
84-
"Couldn't find any queries tagged ide-contextual-queries/local-definitions in any of the following packs: my-qlpack.",
84+
'No definitions queries (tagged "ide-contextual-queries/local-definitions") could be found in the current library path (tried searching the following packs: my-qlpack). Try upgrading the CodeQL libraries. If that doesn\'t work, then definitions queries are not yet available for this language.',
8585
);
8686
}
8787
});

0 commit comments

Comments
 (0)