cypress 5.2.0 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
package/lib/errors.js CHANGED
@@ -1,286 +1,211 @@
1
1
  "use strict";
2
2
 
3
- function _templateObject17() {
4
- var data = _taggedTemplateLiteral(["\n To skip the binary install, set CYPRESS_INSTALL_BINARY=0\n "]);
3
+ const chalk = require('chalk');
5
4
 
6
- _templateObject17 = function _templateObject17() {
7
- return data;
8
- };
9
-
10
- return data;
11
- }
12
-
13
- function _templateObject16() {
14
- var data = _taggedTemplateLiteral(["\n The environment variable CYPRESS_SKIP_BINARY_INSTALL has been removed as of version ", "\n "]);
15
-
16
- _templateObject16 = function _templateObject16() {
17
- return data;
18
- };
19
-
20
- return data;
21
- }
22
-
23
- function _templateObject15() {
24
- var data = _taggedTemplateLiteral(["\n You should set CYPRESS_INSTALL_BINARY instead.\n "]);
25
-
26
- _templateObject15 = function _templateObject15() {
27
- return data;
28
- };
29
-
30
- return data;
31
- }
32
-
33
- function _templateObject14() {
34
- var data = _taggedTemplateLiteral(["\n The environment variable CYPRESS_BINARY_VERSION has been renamed to CYPRESS_INSTALL_BINARY as of version ", "\n "]);
35
-
36
- _templateObject14 = function _templateObject14() {
37
- return data;
38
- };
5
+ const {
6
+ stripIndent,
7
+ stripIndents
8
+ } = require('common-tags');
39
9
 
40
- return data;
41
- }
42
-
43
- function _templateObject13() {
44
- var data = _taggedTemplateLiteral(["\n Please search Cypress documentation for possible solutions:\n\n ", "\n\n Check if there is a GitHub issue describing this crash:\n\n ", "\n\n Consider opening a new issue.\n"]);
45
-
46
- _templateObject13 = function _templateObject13() {
47
- return data;
48
- };
49
-
50
- return data;
51
- }
52
-
53
- function _templateObject12() {
54
- var data = _taggedTemplateLiteral(["\n See discussion and possible solutions at\n ", "\n "]);
55
-
56
- _templateObject12 = function _templateObject12() {
57
- return data;
58
- };
10
+ const {
11
+ merge
12
+ } = require('ramda');
59
13
 
60
- return data;
61
- }
14
+ const la = require('lazy-ass');
62
15
 
63
- function _templateObject11() {
64
- var data = _taggedTemplateLiteral(["\n This is usually caused by a missing library or dependency.\n\n The error below should indicate which dependency is missing.\n\n ", "\n\n If you are using Docker, we provide containers with all required dependencies installed.\n "]);
16
+ const is = require('check-more-types');
65
17
 
66
- _templateObject11 = function _templateObject11() {
67
- return data;
68
- };
18
+ const util = require('./util');
69
19
 
70
- return data;
71
- }
20
+ const state = require('./tasks/state');
72
21
 
73
- function _templateObject10() {
74
- var data = _taggedTemplateLiteral(["\n Cypress failed to start after spawning a new Xvfb server.\n\n The error logs we received were:\n\n ", "\n\n ", "\n\n ", "\n\n This is usually caused by a missing library or dependency.\n\n The error above should indicate which dependency is missing.\n\n ", "\n\n If you are using Docker, we provide containers with all required dependencies installed.\n "]);
22
+ const docsUrl = 'https://on.cypress.io';
23
+ const requiredDependenciesUrl = `${docsUrl}/required-dependencies`;
24
+ const runDocumentationUrl = `${docsUrl}/cypress-run`; // TODO it would be nice if all error objects could be enforced via types
25
+ // to only have description + solution properties
75
26
 
76
- _templateObject10 = function _templateObject10() {
77
- return data;
78
- };
27
+ const hr = '----------';
28
+ const genericErrorSolution = stripIndent`
29
+ Search for an existing issue or open a GitHub issue at
79
30
 
80
- return data;
81
- }
31
+ ${chalk.blue(util.issuesUrl)}
32
+ `; // common errors Cypress application can encounter
82
33
 
83
- function _templateObject9() {
84
- var data = _taggedTemplateLiteral(["\n This command failed with the following output:\n\n ", "\n\n "]);
34
+ const unknownError = {
35
+ description: 'Unknown Cypress CLI error',
36
+ solution: genericErrorSolution
37
+ };
38
+ const invalidRunProjectPath = {
39
+ description: 'Invalid --project path',
40
+ solution: stripIndent`
41
+ Please provide a valid project path.
85
42
 
86
- _templateObject9 = function _templateObject9() {
87
- return data;
88
- };
43
+ Learn more about ${chalk.cyan('cypress run')} at:
89
44
 
90
- return data;
91
- }
45
+ ${chalk.blue(runDocumentationUrl)}
46
+ `
47
+ };
48
+ const failedDownload = {
49
+ description: 'The Cypress App could not be downloaded.',
50
+ solution: stripIndent`
51
+ Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
92
52
 
93
- function _templateObject8() {
94
- var data = _taggedTemplateLiteral(["\n Install Xvfb and run Cypress again.\n\n Read our documentation on dependencies for more information:\n\n ", "\n\n If you are using Docker, we provide containers with all required dependencies installed.\n "]);
53
+ Otherwise, please check network connectivity and try again:`
54
+ };
55
+ const failedUnzip = {
56
+ description: 'The Cypress App could not be unzipped.',
57
+ solution: genericErrorSolution
58
+ };
95
59
 
96
- _templateObject8 = function _templateObject8() {
97
- return data;
60
+ const missingApp = binaryDir => {
61
+ return {
62
+ description: `No version of Cypress is installed in: ${chalk.cyan(binaryDir)}`,
63
+ solution: stripIndent`
64
+ \nPlease reinstall Cypress by running: ${chalk.cyan('cypress install')}
65
+ `
98
66
  };
67
+ };
99
68
 
100
- return data;
101
- }
102
-
103
- function _templateObject7() {
104
- var data = _taggedTemplateLiteral(["\n There was a problem spawning Xvfb.\n\n This is likely a problem with your system, permissions, or installation of Xvfb.\n "]);
105
-
106
- _templateObject7 = function _templateObject7() {
107
- return data;
108
- };
69
+ const binaryNotExecutable = executable => {
70
+ return {
71
+ description: `Cypress cannot run because this binary file does not have executable permissions here:\n\n${executable}`,
72
+ solution: stripIndent`\n
73
+ Reasons this may happen:
109
74
 
110
- return data;
111
- }
75
+ - node was installed as 'root' or with 'sudo'
76
+ - the cypress npm package as 'root' or with 'sudo'
112
77
 
113
- function _templateObject6() {
114
- var data = _taggedTemplateLiteral(["\n\n We expected the binary to be installed here: ", "\n\n Reasons it may be missing:\n\n - You're caching 'node_modules' but are not caching this path: ", "\n - You ran 'npm install' at an earlier build step but did not persist: ", "\n\n Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.\n\n Alternatively, you can run 'cypress install' to download the binary again.\n\n ", "\n "], ["\\n\n We expected the binary to be installed here: ", "\n\n Reasons it may be missing:\n\n - You're caching 'node_modules' but are not caching this path: ", "\n - You ran 'npm install' at an earlier build step but did not persist: ", "\n\n Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.\n\n Alternatively, you can run 'cypress install' to download the binary again.\n\n ", "\n "]);
78
+ Please check that you have the appropriate user permissions.
115
79
 
116
- _templateObject6 = function _templateObject6() {
117
- return data;
80
+ You can also try clearing the cache with 'cypress cache clear' and reinstalling.
81
+ `
118
82
  };
83
+ };
119
84
 
120
- return data;
121
- }
85
+ const notInstalledCI = executable => {
86
+ return {
87
+ description: 'The cypress npm package is installed, but the Cypress binary is missing.',
88
+ solution: stripIndent`\n
89
+ We expected the binary to be installed here: ${chalk.cyan(executable)}
122
90
 
123
- function _templateObject5() {
124
- var data = _taggedTemplateLiteral(["\n\n Reasons this may happen:\n\n - node was installed as 'root' or with 'sudo'\n - the cypress npm package as 'root' or with 'sudo'\n\n Please check that you have the appropriate user permissions.\n\n You can also try clearing the cache with 'cypress cache clear' and reinstalling. \n "], ["\\n\n Reasons this may happen:\n\n - node was installed as 'root' or with 'sudo'\n - the cypress npm package as 'root' or with 'sudo'\n\n Please check that you have the appropriate user permissions.\n\n You can also try clearing the cache with 'cypress cache clear' and reinstalling. \n "]);
91
+ Reasons it may be missing:
125
92
 
126
- _templateObject5 = function _templateObject5() {
127
- return data;
128
- };
93
+ - You're caching 'node_modules' but are not caching this path: ${util.getCacheDir()}
94
+ - You ran 'npm install' at an earlier build step but did not persist: ${util.getCacheDir()}
129
95
 
130
- return data;
131
- }
96
+ Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.
132
97
 
133
- function _templateObject4() {
134
- var data = _taggedTemplateLiteral(["\n \nPlease reinstall Cypress by running: ", "\n "], ["\n \\nPlease reinstall Cypress by running: ", "\n "]);
98
+ Alternatively, you can run 'cypress install' to download the binary again.
135
99
 
136
- _templateObject4 = function _templateObject4() {
137
- return data;
100
+ ${chalk.blue('https://on.cypress.io/not-installed-ci-error')}
101
+ `
138
102
  };
103
+ };
139
104
 
140
- return data;
141
- }
142
-
143
- function _templateObject3() {
144
- var data = _taggedTemplateLiteral(["\n Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration\n\n Otherwise, please check network connectivity and try again:"]);
105
+ const nonZeroExitCodeXvfb = {
106
+ description: 'Xvfb exited with a non zero exit code.',
107
+ solution: stripIndent`
108
+ There was a problem spawning Xvfb.
145
109
 
146
- _templateObject3 = function _templateObject3() {
147
- return data;
148
- };
110
+ This is likely a problem with your system, permissions, or installation of Xvfb.
111
+ `
112
+ };
113
+ const missingXvfb = {
114
+ description: 'Your system is missing the dependency: Xvfb',
115
+ solution: stripIndent`
116
+ Install Xvfb and run Cypress again.
149
117
 
150
- return data;
151
- }
118
+ Read our documentation on dependencies for more information:
152
119
 
153
- function _templateObject2() {
154
- var data = _taggedTemplateLiteral(["\n Please provide a valid project path.\n\n Learn more about ", " at:\n\n ", "\n "]);
120
+ ${chalk.blue(requiredDependenciesUrl)}
155
121
 
156
- _templateObject2 = function _templateObject2() {
157
- return data;
158
- };
122
+ If you are using Docker, we provide containers with all required dependencies installed.
123
+ `
124
+ };
159
125
 
160
- return data;
161
- }
126
+ const smokeTestFailure = (smokeTestCommand, timedOut) => {
127
+ return {
128
+ description: `Cypress verification ${timedOut ? 'timed out' : 'failed'}.`,
129
+ solution: stripIndent`
130
+ This command failed with the following output:
162
131
 
163
- function _templateObject() {
164
- var data = _taggedTemplateLiteral(["\n Search for an existing issue or open a GitHub issue at\n\n ", "\n"]);
132
+ ${smokeTestCommand}
165
133
 
166
- _templateObject = function _templateObject() {
167
- return data;
134
+ `
168
135
  };
136
+ };
169
137
 
170
- return data;
171
- }
172
-
173
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
174
-
175
- var chalk = require('chalk');
176
-
177
- var _require = require('common-tags'),
178
- stripIndent = _require.stripIndent,
179
- stripIndents = _require.stripIndents;
138
+ const invalidSmokeTestDisplayError = {
139
+ code: 'INVALID_SMOKE_TEST_DISPLAY_ERROR',
140
+ description: 'Cypress verification failed.',
180
141
 
181
- var _require2 = require('ramda'),
182
- merge = _require2.merge;
142
+ solution(msg) {
143
+ return stripIndent`
144
+ Cypress failed to start after spawning a new Xvfb server.
183
145
 
184
- var la = require('lazy-ass');
146
+ The error logs we received were:
185
147
 
186
- var is = require('check-more-types');
148
+ ${hr}
187
149
 
188
- var util = require('./util');
150
+ ${msg}
189
151
 
190
- var state = require('./tasks/state');
152
+ ${hr}
191
153
 
192
- var docsUrl = 'https://on.cypress.io';
193
- var requiredDependenciesUrl = "".concat(docsUrl, "/required-dependencies");
194
- var runDocumentationUrl = "".concat(docsUrl, "/cypress-run"); // TODO it would be nice if all error objects could be enforced via types
195
- // to only have description + solution properties
154
+ This is usually caused by a missing library or dependency.
196
155
 
197
- var hr = '----------';
198
- var genericErrorSolution = stripIndent(_templateObject(), chalk.blue(util.issuesUrl)); // common errors Cypress application can encounter
156
+ The error above should indicate which dependency is missing.
199
157
 
200
- var unknownError = {
201
- description: 'Unknown Cypress CLI error',
202
- solution: genericErrorSolution
203
- };
204
- var invalidRunProjectPath = {
205
- description: 'Invalid --project path',
206
- solution: stripIndent(_templateObject2(), chalk.cyan('cypress run'), chalk.blue(runDocumentationUrl))
207
- };
208
- var failedDownload = {
209
- description: 'The Cypress App could not be downloaded.',
210
- solution: stripIndent(_templateObject3())
211
- };
212
- var failedUnzip = {
213
- description: 'The Cypress App could not be unzipped.',
214
- solution: genericErrorSolution
215
- };
158
+ ${chalk.blue(requiredDependenciesUrl)}
216
159
 
217
- var missingApp = function missingApp(binaryDir) {
218
- return {
219
- description: "No version of Cypress is installed in: ".concat(chalk.cyan(binaryDir)),
220
- solution: stripIndent(_templateObject4(), chalk.cyan('cypress install'))
221
- };
222
- };
160
+ If you are using Docker, we provide containers with all required dependencies installed.
161
+ `;
162
+ }
223
163
 
224
- var binaryNotExecutable = function binaryNotExecutable(executable) {
225
- return {
226
- description: "Cypress cannot run because this binary file does not have executable permissions here:\n\n".concat(executable),
227
- solution: stripIndent(_templateObject5())
228
- };
229
- };
230
-
231
- var notInstalledCI = function notInstalledCI(executable) {
232
- return {
233
- description: 'The cypress npm package is installed, but the Cypress binary is missing.',
234
- solution: stripIndent(_templateObject6(), chalk.cyan(executable), util.getCacheDir(), util.getCacheDir(), chalk.blue('https://on.cypress.io/not-installed-ci-error'))
235
- };
236
164
  };
165
+ const missingDependency = {
166
+ description: 'Cypress failed to start.',
167
+ // this message is too Linux specific
168
+ solution: stripIndent`
169
+ This is usually caused by a missing library or dependency.
237
170
 
238
- var nonZeroExitCodeXvfb = {
239
- description: 'Xvfb exited with a non zero exit code.',
240
- solution: stripIndent(_templateObject7())
241
- };
242
- var missingXvfb = {
243
- description: 'Your system is missing the dependency: Xvfb',
244
- solution: stripIndent(_templateObject8(), chalk.blue(requiredDependenciesUrl))
245
- };
171
+ The error below should indicate which dependency is missing.
246
172
 
247
- var smokeTestFailure = function smokeTestFailure(smokeTestCommand, timedOut) {
248
- return {
249
- description: "Cypress verification ".concat(timedOut ? 'timed out' : 'failed', "."),
250
- solution: stripIndent(_templateObject9(), smokeTestCommand)
251
- };
252
- };
173
+ ${chalk.blue(requiredDependenciesUrl)}
253
174
 
254
- var invalidSmokeTestDisplayError = {
255
- code: 'INVALID_SMOKE_TEST_DISPLAY_ERROR',
256
- description: 'Cypress verification failed.',
257
- solution: function solution(msg) {
258
- return stripIndent(_templateObject10(), hr, msg, hr, chalk.blue(requiredDependenciesUrl));
259
- }
175
+ If you are using Docker, we provide containers with all required dependencies installed.
176
+ `
260
177
  };
261
- var missingDependency = {
262
- description: 'Cypress failed to start.',
263
- // this message is too Linux specific
264
- solution: stripIndent(_templateObject11(), chalk.blue(requiredDependenciesUrl))
265
- };
266
- var invalidCacheDirectory = {
178
+ const invalidCacheDirectory = {
267
179
  description: 'Cypress cannot write to the cache directory due to file permissions',
268
- solution: stripIndent(_templateObject12(), chalk.blue(util.getGitHubIssueUrl(1281)))
180
+ solution: stripIndent`
181
+ See discussion and possible solutions at
182
+ ${chalk.blue(util.getGitHubIssueUrl(1281))}
183
+ `
269
184
  };
270
- var versionMismatch = {
185
+ const versionMismatch = {
271
186
  description: 'Installed version does not match package version.',
272
187
  solution: 'Install Cypress and verify app again'
273
188
  };
274
- var incompatibleHeadlessFlags = {
189
+ const incompatibleHeadlessFlags = {
275
190
  description: '`--headed` and `--headless` cannot both be passed.',
276
191
  solution: 'Either pass `--headed` or `--headless`, but not both.'
277
192
  };
278
- var solutionUnknown = stripIndent(_templateObject13(), chalk.blue(docsUrl), chalk.blue(util.issuesUrl));
279
- var unexpected = {
193
+ const solutionUnknown = stripIndent`
194
+ Please search Cypress documentation for possible solutions:
195
+
196
+ ${chalk.blue(docsUrl)}
197
+
198
+ Check if there is a GitHub issue describing this crash:
199
+
200
+ ${chalk.blue(util.issuesUrl)}
201
+
202
+ Consider opening a new issue.
203
+ `;
204
+ const unexpected = {
280
205
  description: 'An unexpected error occurred while verifying the Cypress executable.',
281
206
  solution: solutionUnknown
282
207
  };
283
- var invalidCypressEnv = {
208
+ const invalidCypressEnv = {
284
209
  description: chalk.red('The environment variable with the reserved name "CYPRESS_INTERNAL_ENV" is set.'),
285
210
  solution: chalk.red('Unset the "CYPRESS_INTERNAL_ENV" environment variable and run Cypress again.'),
286
211
  exitCode: 11
@@ -293,37 +218,45 @@ var invalidCypressEnv = {
293
218
  * @param {string} signal Signal that closed the child process, like "SIGBUS"
294
219
  */
295
220
 
296
- var childProcessKilled = function childProcessKilled(eventName, signal) {
221
+ const childProcessKilled = (eventName, signal) => {
297
222
  return {
298
- description: "The Test Runner unexpectedly exited via a ".concat(chalk.cyan(eventName), " event with signal ").concat(chalk.cyan(signal)),
223
+ description: `The Test Runner unexpectedly exited via a ${chalk.cyan(eventName)} event with signal ${chalk.cyan(signal)}`,
299
224
  solution: solutionUnknown
300
225
  };
301
226
  };
302
227
 
303
- var removed = {
228
+ const removed = {
304
229
  CYPRESS_BINARY_VERSION: {
305
- description: stripIndent(_templateObject14(), chalk.green('3.0.0')),
306
- solution: stripIndent(_templateObject15())
230
+ description: stripIndent`
231
+ The environment variable CYPRESS_BINARY_VERSION has been renamed to CYPRESS_INSTALL_BINARY as of version ${chalk.green('3.0.0')}
232
+ `,
233
+ solution: stripIndent`
234
+ You should set CYPRESS_INSTALL_BINARY instead.
235
+ `
307
236
  },
308
237
  CYPRESS_SKIP_BINARY_INSTALL: {
309
- description: stripIndent(_templateObject16(), chalk.green('3.0.0')),
310
- solution: stripIndent(_templateObject17())
238
+ description: stripIndent`
239
+ The environment variable CYPRESS_SKIP_BINARY_INSTALL has been removed as of version ${chalk.green('3.0.0')}
240
+ `,
241
+ solution: stripIndent`
242
+ To skip the binary install, set CYPRESS_INSTALL_BINARY=0
243
+ `
311
244
  }
312
245
  };
313
- var CYPRESS_RUN_BINARY = {
314
- notValid: function notValid(value) {
315
- var properFormat = "**/".concat(state.getPlatformExecutable());
246
+ const CYPRESS_RUN_BINARY = {
247
+ notValid: value => {
248
+ const properFormat = `**/${state.getPlatformExecutable()}`;
316
249
  return {
317
- description: "Could not run binary set by environment variable: CYPRESS_RUN_BINARY=".concat(value),
318
- solution: "Ensure the environment variable is a path to the Cypress binary, matching ".concat(properFormat)
250
+ description: `Could not run binary set by environment variable: CYPRESS_RUN_BINARY=${value}`,
251
+ solution: `Ensure the environment variable is a path to the Cypress binary, matching ${properFormat}`
319
252
  };
320
253
  }
321
254
  };
322
255
 
323
256
  function addPlatformInformation(info) {
324
- return util.getPlatformInfo().then(function (platform) {
257
+ return util.getPlatformInfo().then(platform => {
325
258
  return merge(info, {
326
- platform: platform
259
+ platform
327
260
  });
328
261
  });
329
262
  }
@@ -342,8 +275,8 @@ function addPlatformInformation(info) {
342
275
 
343
276
 
344
277
  function getError(errorObject) {
345
- return formErrorText(errorObject).then(function (errorMessage) {
346
- var err = new Error(errorMessage);
278
+ return formErrorText(errorObject).then(errorMessage => {
279
+ const err = new Error(errorMessage);
347
280
  err.known = true;
348
281
  return err;
349
282
  });
@@ -355,8 +288,8 @@ function getError(errorObject) {
355
288
 
356
289
 
357
290
  function formErrorText(info, msg, prevMessage) {
358
- return addPlatformInformation(info).then(function (obj) {
359
- var formatted = [];
291
+ return addPlatformInformation(info).then(obj => {
292
+ const formatted = [];
360
293
 
361
294
  function add(msg) {
362
295
  formatted.push(stripIndents(msg));
@@ -366,31 +299,55 @@ function formErrorText(info, msg, prevMessage) {
366
299
  // error message and (optional previous error message)
367
300
 
368
301
  if (is.fn(obj.solution)) {
369
- var text = obj.solution(msg, prevMessage);
302
+ const text = obj.solution(msg, prevMessage);
370
303
  la(is.unemptyString(text), 'expected solution to be text', text);
371
- add("\n ".concat(obj.description, "\n\n ").concat(text, "\n\n "));
304
+ add(`
305
+ ${obj.description}
306
+
307
+ ${text}
308
+
309
+ `);
372
310
  } else {
373
311
  la(is.unemptyString(obj.solution), 'expected error solution to be text', obj.solution);
374
- add("\n ".concat(obj.description, "\n\n ").concat(obj.solution, "\n\n "));
312
+ add(`
313
+ ${obj.description}
314
+
315
+ ${obj.solution}
316
+
317
+ `);
375
318
 
376
319
  if (msg) {
377
- add("\n ".concat(hr, "\n\n ").concat(msg, "\n\n "));
320
+ add(`
321
+ ${hr}
322
+
323
+ ${msg}
324
+
325
+ `);
378
326
  }
379
327
  }
380
328
 
381
- add("\n ".concat(hr, "\n\n ").concat(obj.platform, "\n "));
329
+ add(`
330
+ ${hr}
331
+
332
+ ${obj.platform}
333
+ `);
382
334
 
383
335
  if (obj.footer) {
384
- add("\n\n ".concat(hr, "\n\n ").concat(obj.footer, "\n "));
336
+ add(`
337
+
338
+ ${hr}
339
+
340
+ ${obj.footer}
341
+ `);
385
342
  }
386
343
 
387
344
  return formatted.join('\n\n');
388
345
  });
389
346
  }
390
347
 
391
- var raise = function raise(info) {
392
- return function (text) {
393
- var err = new Error(text);
348
+ const raise = info => {
349
+ return text => {
350
+ const err = new Error(text);
394
351
 
395
352
  if (info.code) {
396
353
  err.code = info.code;
@@ -401,8 +358,8 @@ var raise = function raise(info) {
401
358
  };
402
359
  };
403
360
 
404
- var throwFormErrorText = function throwFormErrorText(info) {
405
- return function (msg, prevMessage) {
361
+ const throwFormErrorText = info => {
362
+ return (msg, prevMessage) => {
406
363
  return formErrorText(info, msg, prevMessage).then(raise(info));
407
364
  };
408
365
  };
@@ -414,9 +371,9 @@ var throwFormErrorText = function throwFormErrorText(info) {
414
371
  */
415
372
 
416
373
 
417
- var exitWithError = function exitWithError(info) {
418
- return function (msg) {
419
- return formErrorText(info, msg).then(function (text) {
374
+ const exitWithError = info => {
375
+ return msg => {
376
+ return formErrorText(info, msg).then(text => {
420
377
  // eslint-disable-next-line no-console
421
378
  console.error(text);
422
379
  process.exit(info.exitCode || 1);
@@ -425,33 +382,33 @@ var exitWithError = function exitWithError(info) {
425
382
  };
426
383
 
427
384
  module.exports = {
428
- raise: raise,
429
- exitWithError: exitWithError,
385
+ raise,
386
+ exitWithError,
430
387
  // formError,
431
- formErrorText: formErrorText,
432
- throwFormErrorText: throwFormErrorText,
433
- getError: getError,
434
- hr: hr,
388
+ formErrorText,
389
+ throwFormErrorText,
390
+ getError,
391
+ hr,
435
392
  errors: {
436
- unknownError: unknownError,
437
- nonZeroExitCodeXvfb: nonZeroExitCodeXvfb,
438
- missingXvfb: missingXvfb,
439
- missingApp: missingApp,
440
- notInstalledCI: notInstalledCI,
441
- missingDependency: missingDependency,
442
- invalidSmokeTestDisplayError: invalidSmokeTestDisplayError,
443
- versionMismatch: versionMismatch,
444
- binaryNotExecutable: binaryNotExecutable,
445
- unexpected: unexpected,
446
- failedDownload: failedDownload,
447
- failedUnzip: failedUnzip,
448
- invalidCypressEnv: invalidCypressEnv,
449
- invalidCacheDirectory: invalidCacheDirectory,
450
- removed: removed,
451
- CYPRESS_RUN_BINARY: CYPRESS_RUN_BINARY,
452
- smokeTestFailure: smokeTestFailure,
453
- childProcessKilled: childProcessKilled,
454
- incompatibleHeadlessFlags: incompatibleHeadlessFlags,
455
- invalidRunProjectPath: invalidRunProjectPath
393
+ unknownError,
394
+ nonZeroExitCodeXvfb,
395
+ missingXvfb,
396
+ missingApp,
397
+ notInstalledCI,
398
+ missingDependency,
399
+ invalidSmokeTestDisplayError,
400
+ versionMismatch,
401
+ binaryNotExecutable,
402
+ unexpected,
403
+ failedDownload,
404
+ failedUnzip,
405
+ invalidCypressEnv,
406
+ invalidCacheDirectory,
407
+ removed,
408
+ CYPRESS_RUN_BINARY,
409
+ smokeTestFailure,
410
+ childProcessKilled,
411
+ incompatibleHeadlessFlags,
412
+ invalidRunProjectPath
456
413
  }
457
414
  };