Skip to content

Commit 7713b97

Browse files
committed
Fix diagnostics tests
1 parent 3cc80d5 commit 7713b97

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/jupyterlab-lsp/src/features/diagnostics/diagnostics.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('Diagnostics', () => {
7070
editorExtensionRegistry: env.editorExtensionRegistry,
7171
themeManager: null
7272
});
73+
env.featureManager.register(feature);
7374
await env.init();
7475
});
7576
afterEach(() => {
@@ -222,6 +223,7 @@ describe('Diagnostics', () => {
222223
editorExtensionRegistry: env.editorExtensionRegistry,
223224
themeManager: null
224225
});
226+
env.featureManager.register(feature);
225227
await env.init();
226228
});
227229
afterEach(() => {

packages/jupyterlab-lsp/src/testutils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import {
2424
DocumentConnectionManager,
2525
FeatureManager,
2626
ISocketConnectionOptions,
27-
ILSPOptions
27+
ILSPOptions,
28+
ILSPFeatureManager
2829
} from '@jupyterlab/lsp';
2930
import { LSPConnection } from '@jupyterlab/lsp/lib/connection';
3031
import * as nbformat from '@jupyterlab/nbformat';
@@ -200,6 +201,7 @@ export abstract class TestEnvironment implements ITestEnvironment {
200201
documentOptions: VirtualDocument.IOptions;
201202
editorExtensionRegistry: EditorExtensionRegistry;
202203
editorServices: IEditorServices;
204+
featureManager: ILSPFeatureManager;
203205

204206
constructor(protected options?: TestEnvironment.IOptions) {
205207
this.editorExtensionRegistry = new EditorExtensionRegistry();
@@ -230,6 +232,7 @@ export abstract class TestEnvironment implements ITestEnvironment {
230232
...this.getDefaults(),
231233
...(options?.document || {})
232234
};
235+
this.featureManager = new FeatureManager();
233236
}
234237

235238
protected abstract createWidget(): IDocumentWidget;
@@ -280,7 +283,7 @@ export abstract class TestEnvironment implements ITestEnvironment {
280283
docRegistry,
281284
connectionManager: this.connectionManager,
282285
codeOverridesManager: overridesManager,
283-
featureManager: new FeatureManager(),
286+
featureManager: this.featureManager,
284287
foreignCodeExtractorsManager: foreignCodeExtractors,
285288
translator: nullTranslator
286289
});

0 commit comments

Comments
 (0)