@@ -122,6 +122,11 @@ suite('Terminal Provider', () => {
122122 . returns ( ( )  =>  activeResourceService . object ) ; 
123123
124124 terminal  =  TypeMoq . Mock . ofType < Terminal > ( ) ; 
125+  terminal 
126+  . setup ( ( c )  =>  c . creationOptions ) 
127+  . returns ( ( )  =>  { 
128+  return  {  hideFromUser : false  } ; 
129+  } ) ; 
125130 } ) ; 
126131
127132 test ( 'If terminal.activateCurrentTerminal setting is set, provided terminal should be activated' ,  async  ( )  =>  { 
@@ -168,6 +173,34 @@ suite('Terminal Provider', () => {
168173 configService . verifyAll ( ) ; 
169174 } ) ; 
170175
176+  test ( 'If terminal.activateCurrentTerminal setting is set, but hideFromUser is true, provided terminal should not be activated' ,  async  ( )  =>  { 
177+  terminalSettings . setup ( ( t )  =>  t . activateEnvInCurrentTerminal ) . returns ( ( )  =>  true ) ; 
178+  configService 
179+  . setup ( ( c )  =>  c . getSettings ( resource ) ) 
180+  . returns ( ( )  =>  pythonSettings . object ) 
181+  . verifiable ( TypeMoq . Times . once ( ) ) ; 
182+  activeResourceService 
183+  . setup ( ( a )  =>  a . getActiveResource ( ) ) 
184+  . returns ( ( )  =>  resource ) 
185+  . verifiable ( TypeMoq . Times . once ( ) ) ; 
186+ 
187+  terminal 
188+  . setup ( ( c )  =>  c . creationOptions ) 
189+  . returns ( ( )  =>  { 
190+  return  {  hideFromUser : true  } ; 
191+  } ) ; 
192+ 
193+  terminalProvider  =  new  TerminalProvider ( serviceContainer . object ) ; 
194+  await  terminalProvider . initialize ( terminal . object ) ; 
195+ 
196+  terminalActivator . verify ( 
197+  ( a )  =>  a . activateEnvironmentInTerminal ( TypeMoq . It . isAny ( ) ,  TypeMoq . It . isAny ( ) ) , 
198+  TypeMoq . Times . never ( ) 
199+  ) ; 
200+  activeResourceService . verifyAll ( ) ; 
201+  configService . verifyAll ( ) ; 
202+  } ) ; 
203+ 
171204 test ( 'terminal.activateCurrentTerminal setting is set but provided terminal is undefined' ,  async  ( )  =>  { 
172205 terminalSettings . setup ( ( t )  =>  t . activateEnvInCurrentTerminal ) . returns ( ( )  =>  true ) ; 
173206 configService 
0 commit comments