44import * as sinon from 'sinon' ;
55import * as typeMoq from 'typemoq' ;
66import { GlobalEnvironmentVariableCollection , workspace } from 'vscode' ;
7- import { TerminalEnvVarInjector } from '../../features/terminal/terminalEnvVarInjector' ;
87import { EnvVarManager } from '../../features/execution/envVariableManager' ;
8+ import { TerminalEnvVarInjector } from '../../features/terminal/terminalEnvVarInjector' ;
99
1010interface MockScopedCollection {
1111 clear : sinon . SinonStub ;
@@ -18,6 +18,7 @@ suite('TerminalEnvVarInjector Basic Tests', () => {
1818 let envVarManager : typeMoq . IMock < EnvVarManager > ;
1919 let injector : TerminalEnvVarInjector ;
2020 let mockScopedCollection : MockScopedCollection ;
21+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2122 let workspaceFoldersStub : any ;
2223
2324 setup ( ( ) => {
@@ -35,17 +36,23 @@ suite('TerminalEnvVarInjector Basic Tests', () => {
3536 mockScopedCollection = {
3637 clear : sinon . stub ( ) ,
3738 replace : sinon . stub ( ) ,
38- delete : sinon . stub ( )
39+ delete : sinon . stub ( ) ,
3940 } ;
4041
4142 // Setup environment variable collection to return scoped collection
42- envVarCollection . setup ( x => x . getScoped ( typeMoq . It . isAny ( ) ) ) . returns ( ( ) => mockScopedCollection as any ) ;
43- envVarCollection . setup ( x => x . clear ( ) ) . returns ( ( ) => { } ) ;
43+ envVarCollection . setup ( ( x ) => x . getScoped ( typeMoq . It . isAny ( ) ) ) . returns ( ( ) => mockScopedCollection as any ) ;
44+ envVarCollection . setup ( ( x ) => x . clear ( ) ) . returns ( ( ) => { } ) ;
4445
4546 // Setup minimal mocks for event subscriptions
46- envVarManager . setup ( ( m ) => m . onDidChangeEnvironmentVariables ) . returns ( ( ) => ( {
47- dispose : ( ) => { } ,
48- } ) as any ) ;
47+ envVarManager
48+ . setup ( ( m ) => m . onDidChangeEnvironmentVariables )
49+ . returns (
50+ ( ) =>
51+ ( {
52+ dispose : ( ) => { } ,
53+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54+ } as any ) ,
55+ ) ;
4956 } ) ;
5057
5158 teardown ( ( ) => {
@@ -76,15 +83,18 @@ suite('TerminalEnvVarInjector Basic Tests', () => {
7683 // Arrange
7784 let eventHandlerRegistered = false ;
7885 envVarManager . reset ( ) ;
79- envVarManager . setup ( ( m ) => m . onDidChangeEnvironmentVariables ) . returns ( ( _handler ) => {
80- eventHandlerRegistered = true ;
81- return { dispose : ( ) => { } } as any ;
82- } ) ;
86+ envVarManager
87+ . setup ( ( m ) => m . onDidChangeEnvironmentVariables )
88+ . returns ( ( _handler ) => {
89+ eventHandlerRegistered = true ;
90+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
91+ return { dispose : ( ) => { } } as any ;
92+ } ) ;
8393
8494 // Act
8595 injector = new TerminalEnvVarInjector ( envVarCollection . object , envVarManager . object ) ;
8696
8797 // Assert
8898 sinon . assert . match ( eventHandlerRegistered , true ) ;
8999 } ) ;
90- } ) ;
100+ } ) ;
0 commit comments