Fix tests

This commit is contained in:
Robert
2023-01-30 16:39:52 +00:00
parent 2f573aba0c
commit 1120f2fca8
2 changed files with 9 additions and 8 deletions

View File

@@ -19,8 +19,8 @@ describe("Packaging commands", () => {
const progress = jest.fn();
let quickPickSpy: jest.SpiedFunction<typeof window.showQuickPick>;
let inputBoxSpy: jest.SpiedFunction<typeof window.showInputBox>;
let showAndLogErrorMessageSpy: jest.SpiedFunction<
typeof helpers.showAndLogErrorMessage
let showAndLogExceptionWithTelemetrySpy: jest.SpiedFunction<
typeof helpers.showAndLogExceptionWithTelemetry
>;
let showAndLogInformationMessageSpy: jest.SpiedFunction<
typeof helpers.showAndLogInformationMessage
@@ -33,8 +33,8 @@ describe("Packaging commands", () => {
inputBoxSpy = jest
.spyOn(window, "showInputBox")
.mockResolvedValue(undefined);
showAndLogErrorMessageSpy = jest
.spyOn(helpers, "showAndLogErrorMessage")
showAndLogExceptionWithTelemetrySpy = jest
.spyOn(helpers, "showAndLogExceptionWithTelemetry")
.mockResolvedValue(undefined);
showAndLogInformationMessageSpy = jest
.spyOn(helpers, "showAndLogInformationMessage")
@@ -85,9 +85,10 @@ describe("Packaging commands", () => {
await handleDownloadPacks(cli, progress);
expect(showAndLogErrorMessageSpy).toHaveBeenCalledWith(
expect.stringContaining("Unable to download all packs."),
);
expect(showAndLogExceptionWithTelemetrySpy).toHaveBeenCalled();
expect(
showAndLogExceptionWithTelemetrySpy.mock.calls[0][0].fullMessage,
).toEqual("Unable to download all packs. See log for more details.");
});
it("should install valid workspace pack", async () => {

View File

@@ -81,7 +81,7 @@ describe("queryResolver", () => {
expect(true).toBe(false);
} catch (e) {
expect(getErrorMessage(e)).toBe(
"Couldn't find any queries tagged ide-contextual-queries/local-definitions in any of the following packs: my-qlpack.",
'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.',
);
}
});