@@ -35,13 +35,22 @@ class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
3535}
3636
3737suite ( '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