Skip to content

Commit

Permalink
Bump vscode-tas-client and fix tests (#22493)
Browse files Browse the repository at this point in the history
Closes #22461

Sinon requires the actual object definition, so we need to point it to
the module file that actually has the function.
  • Loading branch information
karthiknadig authored Nov 18, 2023
1 parent 9298b2c commit ef983f4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 56 deletions.
96 changes: 45 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@
"vscode-jsonrpc": "^8.2.0",
"vscode-languageclient": "^9.0.1",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-tas-client": "^0.1.63",
"vscode-tas-client": "^0.1.75",
"which": "^2.0.2",
"winreg": "^1.2.4",
"xml2js": "^0.5.0"
Expand Down
10 changes: 6 additions & 4 deletions src/test/common/experiments/service.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { assert } from 'chai';
import * as sinon from 'sinon';
import { anything, instance, mock, when } from 'ts-mockito';
import { Disposable } from 'vscode-jsonrpc';
import * as tasClient from 'vscode-tas-client';
// sinon can not create a stub if we just point to the exported module
import * as tasClient from 'vscode-tas-client/vscode-tas-client/VSCodeTasClient';
import * as expService from 'vscode-tas-client';
import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment';
import { IApplicationEnvironment, IWorkspaceService } from '../../../client/common/application/types';
import { WorkspaceService } from '../../../client/common/application/workspace';
Expand Down Expand Up @@ -180,7 +182,7 @@ suite('Experimentation service', () => {
getTreatmentVariable = sinon.stub().returns(true);
sinon.stub(tasClient, 'getExperimentationService').returns(({
getTreatmentVariable,
} as unknown) as tasClient.IExperimentationService);
} as unknown) as expService.IExperimentationService);

configureApplicationEnvironment('stable', extensionVersion);
});
Expand Down Expand Up @@ -218,7 +220,7 @@ suite('Experimentation service', () => {
getTreatmentVariable = sinon.stub().returns(false);
sinon.stub(tasClient, 'getExperimentationService').returns(({
getTreatmentVariable,
} as unknown) as tasClient.IExperimentationService);
} as unknown) as expService.IExperimentationService);

configureApplicationEnvironment('stable', extensionVersion);

Expand Down Expand Up @@ -364,7 +366,7 @@ suite('Experimentation service', () => {
getTreatmentVariableStub = sinon.stub().returns(Promise.resolve('value'));
sinon.stub(tasClient, 'getExperimentationService').returns(({
getTreatmentVariable: getTreatmentVariableStub,
} as unknown) as tasClient.IExperimentationService);
} as unknown) as expService.IExperimentationService);

configureApplicationEnvironment('stable', extensionVersion);
});
Expand Down

0 comments on commit ef983f4

Please sign in to comment.