1 |
|
2 |
|
3 |
|
4 | const {allowedJestOptions} = require('../build/jest/cli-options');
|
5 |
|
6 | const jestOptionsDescriptions = {};
|
7 | allowedJestOptions.forEach(arg => {
|
8 | jestOptionsDescriptions[arg] = {
|
9 | type: 'boolean',
|
10 | describe:
|
11 | 'Jest CLI argument. See: https://jestjs.io/docs/en/cli.html#' +
|
12 | arg.toLowerCase(),
|
13 | };
|
14 | });
|
15 |
|
16 | module.exports = {
|
17 | build: {
|
18 | descr: 'Build your app',
|
19 | options: {
|
20 | experimentalServerless: {
|
21 | type: 'boolean',
|
22 | default: false,
|
23 | describe: 'Build a serverless entry',
|
24 | },
|
25 | dir: {
|
26 | type: 'string',
|
27 | default: '.',
|
28 | describe: 'Root path for the application relative to CLI CWD',
|
29 | },
|
30 | production: {
|
31 | type: 'boolean',
|
32 | default: false,
|
33 | describe: 'Build production assets',
|
34 | },
|
35 | 'log-level': {
|
36 | type: 'string',
|
37 | default: 'info',
|
38 | describe: 'Log level to show',
|
39 | },
|
40 | preserveNames: {
|
41 | type: 'boolean',
|
42 | default: false,
|
43 | describe: 'Disable name mangling during script minification',
|
44 | },
|
45 | modernBuildOnly: {
|
46 | type: 'boolean',
|
47 | default: false,
|
48 | describe:
|
49 | 'Build the application only for modern browsers. Will serve the modern bundles on legacy browsers.',
|
50 | },
|
51 | skipSourceMaps: {
|
52 | type: 'boolean',
|
53 | default: false,
|
54 | describe: 'Build without source maps.',
|
55 | },
|
56 | },
|
57 | },
|
58 | dev: {
|
59 | descr: 'Run your app in development',
|
60 | options: {
|
61 | dir: {
|
62 | type: 'string',
|
63 | default: '.',
|
64 | describe: 'Root path for the application relative to CLI CWD',
|
65 | },
|
66 | debug: {
|
67 | type: 'boolean',
|
68 | default: false,
|
69 | describe: 'Debug application',
|
70 | },
|
71 | exitOnError: {
|
72 | type: 'boolean',
|
73 | default: false,
|
74 | describe: 'Exits the development server if an error occurs.',
|
75 | },
|
76 | port: {
|
77 | type: 'number',
|
78 | default: 3000,
|
79 | describe: 'The port at which the app runs',
|
80 | },
|
81 | open: {
|
82 | type: 'boolean',
|
83 | default: true,
|
84 | describe: 'Run without opening the url in your browser',
|
85 | },
|
86 | hmr: {
|
87 | type: 'boolean',
|
88 | default: true,
|
89 | describe: 'Run without hot module replacement',
|
90 | },
|
91 | forceLegacyBuild: {
|
92 | type: 'boolean',
|
93 | default: false,
|
94 | describe: 'Force enable legacy build. By default not compiled in dev.',
|
95 | },
|
96 | 'log-level': {
|
97 | type: 'string',
|
98 | default: 'info',
|
99 | describe: 'Log level to show',
|
100 | },
|
101 | },
|
102 | },
|
103 | profile: {
|
104 | descr: 'Profile your application',
|
105 | options: {
|
106 | dir: {
|
107 | type: 'string',
|
108 | default: '.',
|
109 | describe: 'Root path for the application relative to CLI CWD',
|
110 | },
|
111 | environment: {
|
112 | type: 'string',
|
113 | default: 'production',
|
114 | describe: 'Either `production` or `development`',
|
115 | },
|
116 | port: {
|
117 | type: 'number',
|
118 | default: '4000',
|
119 | describe: 'Port for the bundle analyzer server',
|
120 | },
|
121 | },
|
122 | },
|
123 | start: {
|
124 | descr: 'Run your app',
|
125 | options: {
|
126 | debug: {
|
127 | type: 'boolean',
|
128 | default: false,
|
129 | describe: 'Debug application',
|
130 | },
|
131 | port: {
|
132 | type: 'number',
|
133 | describe:
|
134 | 'Port to start the server on. Defaults to process.env.PORT_HTTP || 3000',
|
135 | },
|
136 | dir: {
|
137 | type: 'string',
|
138 | default: '.',
|
139 | describe: 'Root path for the application relative to CLI CWD',
|
140 | },
|
141 | environment: {
|
142 | type: 'string',
|
143 | describe:
|
144 | "Which environment/assets to run - defaults to first available assets among ['development', 'production']",
|
145 | },
|
146 | },
|
147 | },
|
148 | 'test-app': {},
|
149 | test: {
|
150 | descr: 'Run browser tests, using Jest',
|
151 | options: {
|
152 | collectCoverageFrom: {
|
153 | type: 'string',
|
154 | default: null,
|
155 | describe:
|
156 | 'Comma-separated list of coverage globs added to the Fusion.js default list. You can ignore a path via: !**/path/to/file.js',
|
157 | },
|
158 | dir: {
|
159 | type: 'string',
|
160 | default: '.',
|
161 | describe: 'Root path for the application relative to CLI CWD.',
|
162 | },
|
163 | debug: {
|
164 | type: 'boolean',
|
165 | default: false,
|
166 | describe: 'Debug tests using --inspect-brk and --runInBand.',
|
167 | },
|
168 | match: {
|
169 | type: 'string',
|
170 | default: null,
|
171 | describe: 'Runs test files that match a given string',
|
172 | },
|
173 | env: {
|
174 | type: 'string',
|
175 | default: 'jsdom,node',
|
176 | describe:
|
177 | 'Comma-separated list of environments to run tests in. Defaults to running both node and browser tests.',
|
178 | },
|
179 | testFolder: {
|
180 | type: 'string',
|
181 | default: '',
|
182 | describe:
|
183 | 'Which folder to look for tests in. Deprecated, use testMatch or testRegex instead.',
|
184 | },
|
185 | testMatch: {
|
186 | type: 'string',
|
187 | default: '',
|
188 | describe:
|
189 | 'Which folder to look for tests in. A JSON array of glob patterns.',
|
190 | },
|
191 | testRegex: {
|
192 | type: 'string',
|
193 | default: '',
|
194 | describe:
|
195 | 'Which folder to look for tests in. A JSON array of regexp strings.',
|
196 | },
|
197 | configPath: {
|
198 | type: 'string',
|
199 | describe: 'Path to the jest configuration, used for testing.',
|
200 | },
|
201 | ...jestOptionsDescriptions,
|
202 | },
|
203 | },
|
204 | };
|