瀏覽代碼

fixed lint

Daniel Zlotin 7 年之前
父節點
當前提交
b6b7fc187f
共有 3 個文件被更改,包括 13 次插入43 次删除
  1. 0
    27
      src/commands/Commands.js
  2. 0
    16
      src/commands/Commands.test.js
  3. 13
    0
      src/commands/LayoutBuilder.test.js

+ 0
- 27
src/commands/Commands.js 查看文件

@@ -1,4 +1,3 @@
1
-import _ from 'lodash';
2 1
 import {NativeModules} from 'react-native';
3 2
 const {NativeNavigation} = NativeModules;
4 3
 import * as LayoutBuilder from './LayoutBuilder';
@@ -6,29 +5,3 @@ import * as LayoutBuilder from './LayoutBuilder';
6 5
 export function startApp(params) {
7 6
   NativeNavigation.startApp(LayoutBuilder.parse(params));
8 7
 }
9
-//
10
-//function parseParams(params) {
11
-//  const msg = `invalid params passed to startApp: ${params}`;
12
-//  if (!params) {
13
-//    throw new Error(msg);
14
-//  }
15
-//
16
-//  if (params.tabs) {
17
-//    return parseTabs(params);
18
-//  }
19
-//
20
-//  if (params.container) {
21
-//    return parseContainer(params);
22
-//  }
23
-//
24
-//  throw new Error(msg);
25
-//}
26
-//
27
-//function parseTabs(params) {
28
-////&& params.tabs.length > 0 && _.every(params.tabs, (t) => t.containerKey)
29
-//}
30
-//
31
-//function parseContainer(params) {
32
-//
33
-//}
34
-

+ 0
- 16
src/commands/Commands.test.js 查看文件

@@ -20,21 +20,5 @@ describe('Commands', () => {
20 20
       });
21 21
       expect(mockNativeNavigation.startApp).toHaveBeenCalledTimes(1);
22 22
     });
23
-
24
-    it('adds uniqueId to passed container', () => {
25
-      uut.startApp({
26
-        container: {
27
-          key: 'com.example.MyScreen'
28
-        }
29
-      });
30
-
31
-      expect(mockNativeNavigation.startApp).toHaveBeenCalledWith({
32
-        container: {
33
-          key: 'com.example.MyScreen',
34
-          id: 'container123'
35
-        }
36
-      });
37
-    });
38
-
39 23
   });
40 24
 });

+ 13
- 0
src/commands/LayoutBuilder.test.js 查看文件

@@ -42,5 +42,18 @@ describe('LayoutBuilder', () => {
42 42
         }
43 43
       });
44 44
     });
45
+
46
+    it('adds uniqueId to passed container', () => {
47
+      expect(uut.parse({
48
+        container: {
49
+          key: 'com.example.MyScreen'
50
+        }
51
+      })).toEqual({
52
+        container: {
53
+          key: 'com.example.MyScreen',
54
+          id: 'container123'
55
+        }
56
+      });
57
+    });
45 58
   });
46 59
 });