Skip to content

Commit 3ae0a88

Browse files
committed
test(terminal): fix TerminalRegistry.spec.ts CI failures after getShell() integration (#321)
PR #333 added shellPath and iconPath to Terminal constructor but TerminalRegistry.spec.ts assertions were not updated, causing 4 test failures on ubuntu-latest CI.
1 parent e9dcb02 commit 3ae0a88

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

src/integrations/terminal/__tests__/TerminalRegistry.spec.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import * as vscode from "vscode"
44
import { Terminal } from "../Terminal"
55
import { TerminalRegistry } from "../TerminalRegistry"
6+
import * as shellUtils from "../../../utils/shell"
67

78
const PAGER = process.platform === "win32" ? "" : "cat"
89

@@ -34,6 +35,12 @@ describe("TerminalRegistry", () => {
3435
},
3536
}) as any,
3637
)
38+
39+
vi.spyOn(shellUtils, "getShell").mockReturnValue("/mock/fallback-shell")
40+
})
41+
42+
afterEach(() => {
43+
vi.restoreAllMocks()
3744
})
3845

3946
describe("createTerminal", () => {
@@ -43,13 +50,14 @@ describe("TerminalRegistry", () => {
4350
expect(mockCreateTerminal).toHaveBeenCalledWith({
4451
cwd: "/test/path",
4552
name: "Roo Code",
46-
iconPath: expect.any(Object),
53+
iconPath: expect.objectContaining({ id: expect.any(String) }),
4754
env: {
4855
PAGER,
4956
ROO_ACTIVE: "true",
5057
VTE_VERSION: "0",
5158
PROMPT_EOL_MARK: "",
5259
},
60+
shellPath: "/mock/fallback-shell",
5361
})
5462
})
5563

@@ -64,14 +72,15 @@ describe("TerminalRegistry", () => {
6472
expect(mockCreateTerminal).toHaveBeenCalledWith({
6573
cwd: "/test/path",
6674
name: "Roo Code",
67-
iconPath: expect.any(Object),
75+
iconPath: expect.objectContaining({ id: expect.any(String) }),
6876
env: {
6977
PAGER,
7078
ROO_ACTIVE: "true",
7179
PROMPT_COMMAND: "sleep 0.05",
7280
VTE_VERSION: "0",
7381
PROMPT_EOL_MARK: "",
7482
},
83+
shellPath: "/mock/fallback-shell",
7584
})
7685
} finally {
7786
// Restore original delay
@@ -87,14 +96,15 @@ describe("TerminalRegistry", () => {
8796
expect(mockCreateTerminal).toHaveBeenCalledWith({
8897
cwd: "/test/path",
8998
name: "Roo Code",
90-
iconPath: expect.any(Object),
99+
iconPath: expect.objectContaining({ id: expect.any(String) }),
91100
env: {
92101
PAGER,
93102
ROO_ACTIVE: "true",
94103
VTE_VERSION: "0",
95104
PROMPT_EOL_MARK: "",
96105
ITERM_SHELL_INTEGRATION_INSTALLED: "Yes",
97106
},
107+
shellPath: "/mock/fallback-shell",
98108
})
99109
} finally {
100110
Terminal.setTerminalZshOhMy(false)
@@ -109,14 +119,15 @@ describe("TerminalRegistry", () => {
109119
expect(mockCreateTerminal).toHaveBeenCalledWith({
110120
cwd: "/test/path",
111121
name: "Roo Code",
112-
iconPath: expect.any(Object),
122+
iconPath: expect.objectContaining({ id: expect.any(String) }),
113123
env: {
114124
PAGER,
115125
ROO_ACTIVE: "true",
116126
VTE_VERSION: "0",
117127
PROMPT_EOL_MARK: "",
118128
POWERLEVEL9K_TERM_SHELL_INTEGRATION: "true",
119129
},
130+
shellPath: "/mock/fallback-shell",
120131
})
121132
} finally {
122133
Terminal.setTerminalZshP10k(false)

0 commit comments

Comments
 (0)