|
11 | 11 |
|
12 | 12 | 'use-strict';
|
13 | 13 |
|
14 |
| -const {filterJSFile, parseArgs} = require('../combine-utils.js'); |
15 |
| - |
16 |
| -describe('parseArgs', () => { |
17 |
| - const nodeBin = 'node'; |
18 |
| - const combineApp = 'app'; |
19 |
| - const schemaJson = 'schema.json'; |
20 |
| - const specFile1 = 'NativeSpec.js'; |
21 |
| - const specFile2 = 'SpecNativeComponent.js'; |
22 |
| - |
23 |
| - describe('when no platform provided', () => { |
24 |
| - it('returns null platform, schema and fileList', () => { |
25 |
| - const {platform, outfile, fileList} = parseArgs([ |
26 |
| - nodeBin, |
27 |
| - combineApp, |
28 |
| - schemaJson, |
29 |
| - specFile1, |
30 |
| - specFile2, |
31 |
| - ]); |
32 |
| - |
33 |
| - expect(platform).toBeNull(); |
34 |
| - expect(outfile).toBe(schemaJson); |
35 |
| - expect(fileList).toStrictEqual([specFile1, specFile2]); |
36 |
| - }); |
37 |
| - }); |
38 |
| - |
39 |
| - describe('when platform passed with --platform', () => { |
40 |
| - it('returns the platform, the schema and the fileList', () => { |
41 |
| - const {platform, outfile, fileList} = parseArgs([ |
42 |
| - nodeBin, |
43 |
| - combineApp, |
44 |
| - '--platform', |
45 |
| - 'ios', |
46 |
| - schemaJson, |
47 |
| - specFile1, |
48 |
| - specFile2, |
49 |
| - ]); |
50 |
| - |
51 |
| - expect(platform).toBe('ios'); |
52 |
| - expect(outfile).toBe(schemaJson); |
53 |
| - expect(fileList).toStrictEqual([specFile1, specFile2]); |
54 |
| - }); |
55 |
| - }); |
56 |
| - |
57 |
| - describe('when platform passed with -p', () => { |
58 |
| - it('returns the platform, the schema and the fileList', () => { |
59 |
| - const {platform, outfile, fileList} = parseArgs([ |
60 |
| - nodeBin, |
61 |
| - combineApp, |
62 |
| - '-p', |
63 |
| - 'android', |
64 |
| - schemaJson, |
65 |
| - specFile1, |
66 |
| - specFile2, |
67 |
| - ]); |
68 |
| - |
69 |
| - expect(platform).toBe('android'); |
70 |
| - expect(outfile).toBe(schemaJson); |
71 |
| - expect(fileList).toStrictEqual([specFile1, specFile2]); |
72 |
| - }); |
73 |
| - }); |
74 |
| -}); |
| 14 | +const {filterJSFile} = require('../combine-utils.js'); |
75 | 15 |
|
76 | 16 | describe('filterJSFile', () => {
|
77 | 17 | describe('When the file is not a Spec file', () => {
|
|
0 commit comments