Skip to content

Commit 43650e2

Browse files
authored
Re microsoft#187471. Dispose instantiationService on test finish. (microsoft#187900)
1 parent 12340da commit 43650e2

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/vs/workbench/services/keybinding/test/browser/browserKeyboardMapper.test.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,22 @@ class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
3535
}
3636

3737
suite('keyboard layout loader', () => {
38-
const instantiationService: TestInstantiationService = new TestInstantiationService();
39-
const notitifcationService = instantiationService.stub(INotificationService, new TestNotificationService());
40-
const storageService = instantiationService.stub(IStorageService, new TestStorageService());
41-
const configurationService = instantiationService.stub(IConfigurationService, new TestConfigurationService());
38+
let instantiationService: TestInstantiationService;
39+
let instance: TestKeyboardMapperFactory;
4240

43-
const commandService = instantiationService.stub(ICommandService, {});
44-
const instance = new TestKeyboardMapperFactory(configurationService, notitifcationService, storageService, commandService);
41+
setup(() => {
42+
instantiationService = new TestInstantiationService();
43+
const notitifcationService = instantiationService.stub(INotificationService, new TestNotificationService());
44+
const storageService = instantiationService.stub(IStorageService, new TestStorageService());
45+
const configurationService = instantiationService.stub(IConfigurationService, new TestConfigurationService());
46+
47+
const commandService = instantiationService.stub(ICommandService, {});
48+
instance = new TestKeyboardMapperFactory(configurationService, notitifcationService, storageService, commandService);
49+
});
50+
51+
teardown(() => {
52+
instantiationService.dispose();
53+
});
4554

4655
test('load default US keyboard layout', () => {
4756
assert.notStrictEqual(instance.activeKeyboardLayout, null);

0 commit comments

Comments
 (0)