@@ -35,13 +35,22 @@ class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
35
35
}
36
36
37
37
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 ;
42
40
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
+ } ) ;
45
54
46
55
test ( 'load default US keyboard layout' , ( ) => {
47
56
assert . notStrictEqual ( instance . activeKeyboardLayout , null ) ;
0 commit comments