@@ -122,6 +122,11 @@ suite('Terminal Provider', () => {
122
122
. returns ( ( ) => activeResourceService . object ) ;
123
123
124
124
terminal = TypeMoq . Mock . ofType < Terminal > ( ) ;
125
+ terminal
126
+ . setup ( ( c ) => c . creationOptions )
127
+ . returns ( ( ) => {
128
+ return { hideFromUser : false } ;
129
+ } ) ;
125
130
} ) ;
126
131
127
132
test ( 'If terminal.activateCurrentTerminal setting is set, provided terminal should be activated' , async ( ) => {
@@ -168,6 +173,34 @@ suite('Terminal Provider', () => {
168
173
configService . verifyAll ( ) ;
169
174
} ) ;
170
175
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
+
171
204
test ( 'terminal.activateCurrentTerminal setting is set but provided terminal is undefined' , async ( ) => {
172
205
terminalSettings . setup ( ( t ) => t . activateEnvInCurrentTerminal ) . returns ( ( ) => true ) ;
173
206
configService
0 commit comments