File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/test/common/terminals Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,25 @@ suite('Terminal Service', () => {
190190 } ) ;
191191
192192 // Ensure sendText is called when Python shell integration is disabled.
193+ test ( 'Ensure text is sent to terminal and it is shown when Python shell integration is disabled' , async ( ) => {
194+ pythonConfig
195+ . setup ( ( p ) => p . get ( 'terminal.shellIntegration.enabled' ) )
196+ . returns ( ( ) => false )
197+ . verifiable ( TypeMoq . Times . once ( ) ) ;
198+
199+ terminalHelper
200+ . setup ( ( helper ) => helper . getEnvironmentActivationCommands ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
201+ . returns ( ( ) => Promise . resolve ( undefined ) ) ;
202+ service = new TerminalService ( mockServiceContainer . object ) ;
203+ const textToSend = 'Some Text' ;
204+ terminalHelper . setup ( ( h ) => h . identifyTerminalShell ( TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => TerminalShellType . bash ) ;
205+ terminalManager . setup ( ( t ) => t . createTerminal ( TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => terminal . object ) ;
206+
207+ await service . sendText ( textToSend ) ;
208+
209+ terminal . verify ( ( t ) => t . show ( TypeMoq . It . isValue ( true ) ) , TypeMoq . Times . exactly ( 2 ) ) ;
210+ terminal . verify ( ( t ) => t . sendText ( TypeMoq . It . isValue ( textToSend ) ) , TypeMoq . Times . exactly ( 1 ) ) ;
211+ } ) ;
193212
194213 // Ensure executeCommand is called when Python shell integration and terminal shell integration are both enabled
195214
You can’t perform that action at this time.
0 commit comments