Skip to content

Commit

Permalink
prevent vscode dialog messages when running in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Nov 30, 2023
1 parent 89c2f28 commit 40f84c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/src/popups/showAnalyticsAllowPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
window,
ExtensionContext,
ConfigurationTarget,
ExtensionMode,
} from "vscode";

const PREVIOUSLY_SHOWN_TELEMETRY_LABEL = "previouslyShownTelemetryMessage";
Expand All @@ -12,6 +13,12 @@ export async function showAnalyticsAllowPopup({
}: {
context: ExtensionContext;
}): Promise<void> {
if (context.extensionMode === ExtensionMode.Test) {
// Dialog messages are prohibited in tests:
// https://github.com/microsoft/vscode/blob/36fefc828e4c496a7bbb64c63f3eb3052a650f8f/src/vs/workbench/services/dialogs/common/dialogService.ts#L56
return;
}

// TODO: remove this once we are happy we have most people reconfirmed
await context.globalState.update("shownTelemetryMessage", undefined);

Expand Down

0 comments on commit 40f84c7

Please sign in to comment.