@@ -12,6 +12,7 @@ import {
12
12
TerminalLinkContext ,
13
13
Terminal ,
14
14
EventEmitter ,
15
+ workspace ,
15
16
} from 'vscode' ;
16
17
import { assert } from 'chai' ;
17
18
import * as workspaceApis from '../../../client/common/vscodeApis/workspaceApis' ;
@@ -35,6 +36,7 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
35
36
globalEnvironmentVariableCollection = TypeMoq . Mock . ofType < GlobalEnvironmentVariableCollection > ( ) ;
36
37
context . setup ( ( c ) => c . environmentVariableCollection ) . returns ( ( ) => globalEnvironmentVariableCollection . object ) ;
37
38
context . setup ( ( c ) => c . storageUri ) . returns ( ( ) => Uri . parse ( 'a' ) ) ;
39
+ context . setup ( ( c ) => c . subscriptions ) . returns ( ( ) => [ ] ) ;
38
40
39
41
globalEnvironmentVariableCollection
40
42
. setup ( ( c ) => c . replace ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
@@ -146,6 +148,17 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
146
148
147
149
registerTerminalLinkProviderStub . restore ( ) ;
148
150
} ) ;
151
+
152
+ test ( 'Verify onDidChangeConfiguration is called when configuration changes' , async ( ) => {
153
+ const onDidChangeConfigurationSpy = sinon . spy ( workspace , 'onDidChangeConfiguration' ) ;
154
+ pythonConfig . setup ( ( p ) => p . get ( 'terminal.shellIntegration.enabled' ) ) . returns ( ( ) => true ) ;
155
+
156
+ await registerPythonStartup ( context . object ) ;
157
+
158
+ assert . isTrue ( onDidChangeConfigurationSpy . calledOnce ) ;
159
+ onDidChangeConfigurationSpy . restore ( ) ;
160
+ } ) ;
161
+
149
162
if ( process . platform === 'darwin' ) {
150
163
test ( 'Mac - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
151
164
const provider = new CustomTerminalLinkProvider ( ) ;
0 commit comments