From f29a5fa9a4dff9fdb54931b97392500f35f793d9 Mon Sep 17 00:00:00 2001 From: Eric Wheeler Date: Tue, 11 Mar 2025 21:03:07 -0700 Subject: [PATCH] test: add workspace configuration mock for terminal tests Mock VSCode workspace configuration to handle PowerShell detection in terminal tests. This prevents TypeError when accessing getConfiguration() in TerminalProcess.run() Signed-off-by: Eric Wheeler --- .../terminal/__tests__/TerminalProcessExec.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/integrations/terminal/__tests__/TerminalProcessExec.test.ts b/src/integrations/terminal/__tests__/TerminalProcessExec.test.ts index 0e719daa1b..afe6a4513a 100644 --- a/src/integrations/terminal/__tests__/TerminalProcessExec.test.ts +++ b/src/integrations/terminal/__tests__/TerminalProcessExec.test.ts @@ -14,6 +14,11 @@ jest.mock("vscode", () => { } return { + workspace: { + getConfiguration: jest.fn().mockReturnValue({ + get: jest.fn().mockReturnValue(null), + }), + }, window: { createTerminal: jest.fn(), onDidStartTerminalShellExecution: jest.fn().mockImplementation((handler) => {