@@ -8,7 +8,9 @@ import { assert } from 'chai';
8
8
import * as sinon from 'sinon' ;
9
9
import { anything , instance , mock , when } from 'ts-mockito' ;
10
10
import { Disposable } from 'vscode-jsonrpc' ;
11
- import * as tasClient from 'vscode-tas-client' ;
11
+ // sinon can not create a stub if we just point to the exported module
12
+ import * as tasClient from 'vscode-tas-client/vscode-tas-client/VSCodeTasClient' ;
13
+ import * as expService from 'vscode-tas-client' ;
12
14
import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment' ;
13
15
import { IApplicationEnvironment , IWorkspaceService } from '../../../client/common/application/types' ;
14
16
import { WorkspaceService } from '../../../client/common/application/workspace' ;
@@ -180,7 +182,7 @@ suite('Experimentation service', () => {
180
182
getTreatmentVariable = sinon . stub ( ) . returns ( true ) ;
181
183
sinon . stub ( tasClient , 'getExperimentationService' ) . returns ( ( {
182
184
getTreatmentVariable,
183
- } as unknown ) as tasClient . IExperimentationService ) ;
185
+ } as unknown ) as expService . IExperimentationService ) ;
184
186
185
187
configureApplicationEnvironment ( 'stable' , extensionVersion ) ;
186
188
} ) ;
@@ -218,7 +220,7 @@ suite('Experimentation service', () => {
218
220
getTreatmentVariable = sinon . stub ( ) . returns ( false ) ;
219
221
sinon . stub ( tasClient , 'getExperimentationService' ) . returns ( ( {
220
222
getTreatmentVariable,
221
- } as unknown ) as tasClient . IExperimentationService ) ;
223
+ } as unknown ) as expService . IExperimentationService ) ;
222
224
223
225
configureApplicationEnvironment ( 'stable' , extensionVersion ) ;
224
226
@@ -364,7 +366,7 @@ suite('Experimentation service', () => {
364
366
getTreatmentVariableStub = sinon . stub ( ) . returns ( Promise . resolve ( 'value' ) ) ;
365
367
sinon . stub ( tasClient , 'getExperimentationService' ) . returns ( ( {
366
368
getTreatmentVariable : getTreatmentVariableStub ,
367
- } as unknown ) as tasClient . IExperimentationService ) ;
369
+ } as unknown ) as expService . IExperimentationService ) ;
368
370
369
371
configureApplicationEnvironment ( 'stable' , extensionVersion ) ;
370
372
} ) ;
0 commit comments