Browse Source

Fix js test

Guy Carmeli 5 years ago
parent
commit
1cd6a44a11
3 changed files with 7 additions and 7 deletions
  1. 2
    2
      lib/src/commands/Commands.test.ts
  2. 4
    4
      lib/src/commands/OptionsProcessor.test.ts
  3. 1
    1
      package.json

+ 2
- 2
lib/src/commands/Commands.test.ts View File

27
     commandsObserver = new CommandsObserver(uniqueIdProvider);
27
     commandsObserver = new CommandsObserver(uniqueIdProvider);
28
 
28
 
29
     const mockedOptionsProcessor = mock(OptionsProcessor);
29
     const mockedOptionsProcessor = mock(OptionsProcessor);
30
-    const optionsProcessor = instance(mockedOptionsProcessor);
30
+    const optionsProcessor = instance(mockedOptionsProcessor) as OptionsProcessor;
31
 
31
 
32
     uut = new Commands(
32
     uut = new Commands(
33
       instance(mockedNativeCommandsSender),
33
       instance(mockedNativeCommandsSender),
366
       mockedLayoutTreeParser = mock(LayoutTreeParser);
366
       mockedLayoutTreeParser = mock(LayoutTreeParser);
367
       mockedLayoutTreeCrawler = mock(LayoutTreeCrawler);
367
       mockedLayoutTreeCrawler = mock(LayoutTreeCrawler);
368
       commandsObserver.register(cb);
368
       commandsObserver.register(cb);
369
-      const mockedOptionsProcessor = mock(OptionsProcessor);
369
+      const mockedOptionsProcessor = mock(OptionsProcessor) as OptionsProcessor;
370
       anotherMockedUniqueIdProvider = mock(UniqueIdProvider);
370
       anotherMockedUniqueIdProvider = mock(UniqueIdProvider);
371
       when(anotherMockedUniqueIdProvider.generate(anything())).thenCall(
371
       when(anotherMockedUniqueIdProvider.generate(anything())).thenCall(
372
         (prefix) => `${prefix}+UNIQUE_ID`
372
         (prefix) => `${prefix}+UNIQUE_ID`

+ 4
- 4
lib/src/commands/OptionsProcessor.test.ts View File

8
 
8
 
9
 describe('navigation options', () => {
9
 describe('navigation options', () => {
10
   let uut: OptionsProcessor;
10
   let uut: OptionsProcessor;
11
-  const mockedStore = mock(Store);
12
-  const store = instance(mockedStore);
11
+  const mockedStore = mock(Store) as Store;
12
+  const store = instance(mockedStore) as Store;
13
 
13
 
14
   beforeEach(() => {
14
   beforeEach(() => {
15
-    const mockedAssetService = mock(AssetService);
15
+    const mockedAssetService = mock(AssetService) as AssetService;
16
     when(mockedAssetService.resolveFromRequire(anyNumber())).thenReturn({
16
     when(mockedAssetService.resolveFromRequire(anyNumber())).thenReturn({
17
       height: 100,
17
       height: 100,
18
       scale: 1,
18
       scale: 1,
21
     });
21
     });
22
     const assetService = instance(mockedAssetService);
22
     const assetService = instance(mockedAssetService);
23
 
23
 
24
-    const mockedColorService = mock(ColorService);
24
+    const mockedColorService = mock(ColorService) as ColorService;
25
     when(mockedColorService.toNativeColor(anyString())).thenReturn(666);
25
     when(mockedColorService.toNativeColor(anyString())).thenReturn(666);
26
     const colorService = instance(mockedColorService);
26
     const colorService = instance(mockedColorService);
27
 
27
 

+ 1
- 1
package.json View File

152
       }
152
       }
153
     }
153
     }
154
   }
154
   }
155
-}
155
+}