From 2d5c339e0e9b3b7f0c6dd9e171c35357cc27f4a5 Mon Sep 17 00:00:00 2001 From: Koen Vlaswinkel Date: Thu, 9 Mar 2023 11:16:04 +0100 Subject: [PATCH] Add check for error message for packaging.test.ts This will add a check to ensure that `showAndLogExceptionWithTelemetry` is not called when downloading packs. This expectation is placed before the check for `showAndLogInformationMessage` so that when the test fails, the error message will be shown. --- .../test/vscode-tests/cli-integration/packaging.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/ql-vscode/test/vscode-tests/cli-integration/packaging.test.ts b/extensions/ql-vscode/test/vscode-tests/cli-integration/packaging.test.ts index 969d95a122b..eba712e002a 100644 --- a/extensions/ql-vscode/test/vscode-tests/cli-integration/packaging.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/cli-integration/packaging.test.ts @@ -61,6 +61,7 @@ describe("Packaging commands", () => { ); await handleDownloadPacks(cli, progress); + expect(showAndLogExceptionWithTelemetrySpy).not.toHaveBeenCalled(); expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith( expect.stringContaining("Finished downloading packs."), ); @@ -73,6 +74,7 @@ describe("Packaging commands", () => { inputBoxSpy.mockResolvedValue("codeql/csharp-solorigate-queries"); await handleDownloadPacks(cli, progress); + expect(showAndLogExceptionWithTelemetrySpy).not.toHaveBeenCalled(); expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith( expect.stringContaining("Finished downloading packs."), );