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

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

@@ -8,11 +8,11 @@ import { AssetService } from '../adapters/AssetResolver';
8 8
 
9 9
 describe('navigation options', () => {
10 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 14
   beforeEach(() => {
15
-    const mockedAssetService = mock(AssetService);
15
+    const mockedAssetService = mock(AssetService) as AssetService;
16 16
     when(mockedAssetService.resolveFromRequire(anyNumber())).thenReturn({
17 17
       height: 100,
18 18
       scale: 1,
@@ -21,7 +21,7 @@ describe('navigation options', () => {
21 21
     });
22 22
     const assetService = instance(mockedAssetService);
23 23
 
24
-    const mockedColorService = mock(ColorService);
24
+    const mockedColorService = mock(ColorService) as ColorService;
25 25
     when(mockedColorService.toNativeColor(anyString())).thenReturn(666);
26 26
     const colorService = instance(mockedColorService);
27 27
 

+ 1
- 1
package.json View File

@@ -152,4 +152,4 @@
152 152
       }
153 153
     }
154 154
   }
155
-}
155
+}