Skip to content

Commit a80b060

Browse files
committed
fix jedi test
1 parent 2b24b88 commit a80b060

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/test/languageServer/jediLSExtensionManager.unit.test.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33

44
import * as assert from 'assert';
55

6-
import { IWorkspaceService, ICommandManager } from '../../client/common/application/types';
7-
import { IExperimentService, IConfigurationService, IInterpreterPathService } from '../../client/common/types';
6+
import { IWorkspaceService, ICommandManager, IApplicationShell } from '../../client/common/application/types';
7+
import {
8+
IExperimentService,
9+
IConfigurationService,
10+
IInterpreterPathService,
11+
ILogOutputChannel,
12+
} from '../../client/common/types';
813
import { IEnvironmentVariablesProvider } from '../../client/common/variables/types';
914
import { IInterpreterService } from '../../client/interpreter/contracts';
1015
import { IServiceContainer } from '../../client/ioc/types';
@@ -15,8 +20,26 @@ suite('Language Server - Jedi LS extension manager', () => {
1520
let manager: JediLSExtensionManager;
1621

1722
setup(() => {
23+
// Create a mock ILogOutputChannel
24+
const mockOutputChannel = {} as ILogOutputChannel;
25+
26+
// Create a mock IApplicationShell with createOutputChannel method
27+
const mockApplicationShell = ({
28+
createOutputChannel: () => mockOutputChannel,
29+
} as unknown) as IApplicationShell;
30+
31+
// Create a mock service container with the required get method
32+
const mockServiceContainer = {
33+
get: (serviceIdentifier: any) => {
34+
if (serviceIdentifier === IApplicationShell) {
35+
return mockApplicationShell;
36+
}
37+
return undefined;
38+
},
39+
} as IServiceContainer;
40+
1841
manager = new JediLSExtensionManager(
19-
{} as IServiceContainer,
42+
mockServiceContainer,
2043
{} as IExperimentService,
2144
{} as IWorkspaceService,
2245
{} as IConfigurationService,

0 commit comments

Comments
 (0)