Skip to content

Commit f29a5fa

Browse files
author
Eric Wheeler
committed
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]>
1 parent a25f1d9 commit f29a5fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/integrations/terminal/__tests__/TerminalProcessExec.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jest.mock("vscode", () => {
1414
}
1515

1616
return {
17+
workspace: {
18+
getConfiguration: jest.fn().mockReturnValue({
19+
get: jest.fn().mockReturnValue(null),
20+
}),
21+
},
1722
window: {
1823
createTerminal: jest.fn(),
1924
onDidStartTerminalShellExecution: jest.fn().mockImplementation((handler) => {

0 commit comments

Comments
 (0)