Browse Source

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 <[email protected]>
Eric Wheeler 11 months ago
parent
commit
f29a5fa9a4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/integrations/terminal/__tests__/TerminalProcessExec.test.ts

+ 5 - 0
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) => {