33import * as vscode from "vscode"
44import { Terminal } from "../Terminal"
55import { TerminalRegistry } from "../TerminalRegistry"
6+ import * as shellUtils from "../../../utils/shell"
67
78const 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