33
44import * as sinon from 'sinon' ;
55import * as typeMoq from 'typemoq' ;
6- import { Disposable , GlobalEnvironmentVariableCollection , workspace , WorkspaceFolder } from 'vscode' ;
7- import { DidChangeEnvironmentVariablesEventArgs } from '../../api' ;
6+ import { GlobalEnvironmentVariableCollection , workspace } from 'vscode' ;
87import { EnvVarManager } from '../../features/execution/envVariableManager' ;
98import { TerminalEnvVarInjector } from '../../features/terminal/terminalEnvVarInjector' ;
109
@@ -19,7 +18,8 @@ suite('TerminalEnvVarInjector Basic Tests', () => {
1918 let envVarManager : typeMoq . IMock < EnvVarManager > ;
2019 let injector : TerminalEnvVarInjector ;
2120 let mockScopedCollection : MockScopedCollection ;
22- let workspaceFoldersStub : WorkspaceFolder [ ] ;
21+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22+ let workspaceFoldersStub : any ;
2323
2424 setup ( ( ) => {
2525 envVarCollection = typeMoq . Mock . ofType < GlobalEnvironmentVariableCollection > ( ) ;
@@ -40,25 +40,19 @@ suite('TerminalEnvVarInjector Basic Tests', () => {
4040 } ;
4141
4242 // Setup environment variable collection to return scoped collection
43- envVarCollection . setup ( ( x ) => x . getScoped ( typeMoq . It . isAny ( ) ) ) . returns ( ( ) => mockScopedCollection as never ) ;
43+ envVarCollection . setup ( ( x ) => x . getScoped ( typeMoq . It . isAny ( ) ) ) . returns ( ( ) => mockScopedCollection as any ) ;
4444 envVarCollection . setup ( ( x ) => x . clear ( ) ) . returns ( ( ) => { } ) ;
4545
4646 // Setup minimal mocks for event subscriptions
4747 envVarManager
4848 . setup ( ( m ) => m . onDidChangeEnvironmentVariables )
49- . returns ( ( ) => {
50- // Return a mock Event function that returns a Disposable when called
51- const mockEvent = ( _listener : ( e : DidChangeEnvironmentVariablesEventArgs ) => void ) =>
49+ . returns (
50+ ( ) =>
5251 ( {
5352 dispose : ( ) => { } ,
54- } as Disposable ) ;
55- return mockEvent ;
56- } ) ;
57-
58- // Mock workspace.onDidChangeConfiguration to return a Disposable
59- sinon . stub ( workspace , 'onDidChangeConfiguration' ) . returns ( {
60- dispose : ( ) => { } ,
61- } as Disposable ) ;
53+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54+ } as any ) ,
55+ ) ;
6256 } ) ;
6357
6458 teardown ( ( ) => {
@@ -91,21 +85,12 @@ suite('TerminalEnvVarInjector Basic Tests', () => {
9185 envVarManager . reset ( ) ;
9286 envVarManager
9387 . setup ( ( m ) => m . onDidChangeEnvironmentVariables )
94- . returns ( ( ) => {
88+ . returns ( ( _handler ) => {
9589 eventHandlerRegistered = true ;
96- // Return a mock Event function that returns a Disposable when called
97- const mockEvent = ( _listener : ( e : DidChangeEnvironmentVariablesEventArgs ) => void ) =>
98- ( {
99- dispose : ( ) => { } ,
100- } as Disposable ) ;
101- return mockEvent ;
90+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
91+ return { dispose : ( ) => { } } as any ;
10292 } ) ;
10393
104- // Mock workspace.onDidChangeConfiguration to return a Disposable
105- sinon . stub ( workspace , 'onDidChangeConfiguration' ) . returns ( {
106- dispose : ( ) => { } ,
107- } as Disposable ) ;
108-
10994 // Act
11095 injector = new TerminalEnvVarInjector ( envVarCollection . object , envVarManager . object ) ;
11196
0 commit comments