cypress 15.1.0 → 15.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,288 +1,301 @@
1
1
  "use strict";
2
-
3
- const _ = require('lodash');
4
- const chalk = require('chalk');
5
- const {
6
- Listr
7
- } = require('listr2');
8
- const debug = require('debug')('cypress:cli');
9
- const {
10
- stripIndent
11
- } = require('common-tags');
12
- const Promise = require('bluebird');
13
- const logSymbols = require('log-symbols');
14
- const path = require('path');
15
- const os = require('os');
16
- const verbose = require('../VerboseRenderer');
17
- const {
18
- throwFormErrorText,
19
- errors
20
- } = require('../errors');
21
- const util = require('../util');
22
- const logger = require('../logger');
23
- const xvfb = require('../exec/xvfb');
24
- const state = require('./state');
25
- const VERIFY_TEST_RUNNER_TIMEOUT_MS = +util.getEnv('CYPRESS_VERIFY_TIMEOUT') || 30000;
26
- const checkExecutable = binaryDir => {
27
- const executable = state.getPathToExecutable(binaryDir);
28
- debug('checking if executable exists', executable);
29
- return util.isExecutableAsync(executable).then(isExecutable => {
30
- debug('Binary is executable? :', isExecutable);
31
- if (!isExecutable) {
32
- return throwFormErrorText(errors.binaryNotExecutable(executable))();
33
- }
34
- }).catch({
35
- code: 'ENOENT'
36
- }, () => {
37
- if (util.isCi()) {
38
- return throwFormErrorText(errors.notInstalledCI(executable))();
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const lodash_1 = __importDefault(require("lodash"));
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const listr2_1 = require("listr2");
9
+ const debug_1 = __importDefault(require("debug"));
10
+ const common_tags_1 = require("common-tags");
11
+ const bluebird_1 = __importDefault(require("bluebird"));
12
+ const log_symbols_1 = __importDefault(require("log-symbols"));
13
+ const path_1 = __importDefault(require("path"));
14
+ const os_1 = __importDefault(require("os"));
15
+ const VerboseRenderer_1 = __importDefault(require("../VerboseRenderer"));
16
+ const errors_1 = require("../errors");
17
+ const util_1 = __importDefault(require("../util"));
18
+ const logger_1 = __importDefault(require("../logger"));
19
+ const xvfb_1 = __importDefault(require("../exec/xvfb"));
20
+ const state_1 = __importDefault(require("./state"));
21
+ const debug = (0, debug_1.default)('cypress:cli');
22
+ const VERIFY_TEST_RUNNER_TIMEOUT_MS = (() => {
23
+ const verifyTimeout = +((util_1.default === null || util_1.default === void 0 ? void 0 : util_1.default.getEnv('CYPRESS_VERIFY_TIMEOUT')) || 'NaN');
24
+ if (lodash_1.default.isNumber(verifyTimeout) && !lodash_1.default.isNaN(verifyTimeout)) {
25
+ return verifyTimeout;
39
26
  }
40
- return throwFormErrorText(errors.missingApp(binaryDir))(stripIndent`
41
- Cypress executable not found at: ${chalk.cyan(executable)}
27
+ return 30000;
28
+ })();
29
+ const checkExecutable = (binaryDir) => {
30
+ const executable = state_1.default.getPathToExecutable(binaryDir);
31
+ debug('checking if executable exists', executable);
32
+ return util_1.default.isExecutableAsync(executable)
33
+ .then((isExecutable) => {
34
+ debug('Binary is executable? :', isExecutable);
35
+ if (!isExecutable) {
36
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.binaryNotExecutable(executable))();
37
+ }
38
+ })
39
+ .catch({ code: 'ENOENT' }, () => {
40
+ if (util_1.default.isCi()) {
41
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.notInstalledCI(executable))();
42
+ }
43
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.missingApp(binaryDir))((0, common_tags_1.stripIndent) `
44
+ Cypress executable not found at: ${chalk_1.default.cyan(executable)}
42
45
  `);
43
- });
46
+ });
44
47
  };
45
48
  const runSmokeTest = (binaryDir, options) => {
46
- let executable = state.getPathToExecutable(binaryDir);
47
- const onSmokeTestError = (smokeTestCommand, linuxWithDisplayEnv) => {
48
- return err => {
49
- debug('Smoke test failed:', err);
50
- let errMessage = err.stderr || err.message;
51
- debug('error message:', errMessage);
52
- if (err.timedOut) {
53
- debug('error timedOut is true');
54
- return throwFormErrorText(errors.smokeTestFailure(smokeTestCommand, true))(errMessage);
55
- }
56
- if (linuxWithDisplayEnv && util.isBrokenGtkDisplay(errMessage)) {
57
- util.logBrokenGtkDisplayWarning();
58
- return throwFormErrorText(errors.invalidSmokeTestDisplayError)(errMessage);
59
- }
60
- return throwFormErrorText(errors.missingDependency)(errMessage);
49
+ let executable = state_1.default.getPathToExecutable(binaryDir);
50
+ const onSmokeTestError = (smokeTestCommand, linuxWithDisplayEnv) => {
51
+ return (err) => {
52
+ debug('Smoke test failed:', err);
53
+ let errMessage = err.stderr || err.message;
54
+ debug('error message:', errMessage);
55
+ if (err.timedOut) {
56
+ debug('error timedOut is true');
57
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.smokeTestFailure(smokeTestCommand, true))(errMessage);
58
+ }
59
+ if (linuxWithDisplayEnv && util_1.default.isBrokenGtkDisplay(errMessage)) {
60
+ util_1.default.logBrokenGtkDisplayWarning();
61
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.invalidSmokeTestDisplayError)(errMessage);
62
+ }
63
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.missingDependency)(errMessage);
64
+ };
61
65
  };
62
- };
63
- const needsXvfb = xvfb.isNeeded();
64
- debug('needs Xvfb?', needsXvfb);
65
-
66
- /**
67
- * Spawn Cypress running smoke test to check if all operating system
68
- * dependencies are good.
69
- */
70
- const spawn = linuxWithDisplayEnv => {
71
- const random = _.random(0, 1000);
72
- const args = ['--smoke-test', `--ping=${random}`];
73
- if (needsSandbox()) {
74
- // electron requires --no-sandbox to run as root
75
- debug('disabling Electron sandbox');
76
- args.unshift('--no-sandbox');
77
- }
78
- if (options.dev) {
79
- executable = 'node';
80
- args.unshift(path.resolve(__dirname, '..', '..', '..', 'scripts', 'start.js'));
66
+ const needsXvfb = xvfb_1.default.isNeeded();
67
+ debug('needs Xvfb?', needsXvfb);
68
+ /**
69
+ * Spawn Cypress running smoke test to check if all operating system
70
+ * dependencies are good.
71
+ */
72
+ const spawn = (linuxWithDisplayEnv) => {
73
+ const random = lodash_1.default.random(0, 1000);
74
+ const args = ['--smoke-test', `--ping=${random}`];
75
+ if (needsSandbox()) {
76
+ // electron requires --no-sandbox to run as root
77
+ debug('disabling Electron sandbox');
78
+ args.unshift('--no-sandbox');
79
+ }
80
+ if (options.dev) {
81
+ executable = 'node';
82
+ args.unshift(path_1.default.resolve(__dirname, '..', '..', '..', 'scripts', 'start.js'));
83
+ }
84
+ const smokeTestCommand = `${executable} ${args.join(' ')}`;
85
+ debug('running smoke test');
86
+ debug('using Cypress executable %s', executable);
87
+ debug('smoke test command:', smokeTestCommand);
88
+ debug('smoke test timeout %d ms', options.smokeTestTimeout);
89
+ const stdioOptions = lodash_1.default.extend({}, {
90
+ env: Object.assign(Object.assign({}, process.env), { FORCE_COLOR: '0' }),
91
+ timeout: options.smokeTestTimeout,
92
+ });
93
+ return bluebird_1.default.resolve(util_1.default.exec(executable, args, stdioOptions))
94
+ .catch(onSmokeTestError(smokeTestCommand, linuxWithDisplayEnv))
95
+ .then((result) => {
96
+ // TODO: when execa > 1.1 is released
97
+ // change this to `result.all` for both stderr and stdout
98
+ // use lodash to be robust during tests against null result or missing stdout
99
+ const smokeTestStdout = lodash_1.default.get(result, 'stdout', '');
100
+ debug('smoke test stdout "%s"', smokeTestStdout);
101
+ if (!util_1.default.stdoutLineMatches(String(random), smokeTestStdout)) {
102
+ debug('Smoke test failed because could not find %d in:', random, result);
103
+ const smokeTestStderr = lodash_1.default.get(result, 'stderr', '');
104
+ const errorText = smokeTestStderr || smokeTestStdout;
105
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.smokeTestFailure(smokeTestCommand, false))(errorText);
106
+ }
107
+ });
108
+ };
109
+ const spawnInXvfb = (linuxWithDisplayEnv) => {
110
+ return xvfb_1.default
111
+ .start()
112
+ .then(() => {
113
+ return spawn(linuxWithDisplayEnv || false);
114
+ })
115
+ .finally(xvfb_1.default.stop);
116
+ };
117
+ const userFriendlySpawn = (linuxWithDisplayEnv) => {
118
+ debug('spawning, should retry on display problem?', Boolean(linuxWithDisplayEnv));
119
+ return spawn(linuxWithDisplayEnv)
120
+ .catch({ code: 'INVALID_SMOKE_TEST_DISPLAY_ERROR' }, () => {
121
+ return spawnInXvfb(linuxWithDisplayEnv);
122
+ });
123
+ };
124
+ if (needsXvfb) {
125
+ return spawnInXvfb();
81
126
  }
82
- const smokeTestCommand = `${executable} ${args.join(' ')}`;
83
- debug('running smoke test');
84
- debug('using Cypress executable %s', executable);
85
- debug('smoke test command:', smokeTestCommand);
86
- debug('smoke test timeout %d ms', options.smokeTestTimeout);
87
- const stdioOptions = _.extend({}, {
88
- env: {
89
- ...process.env,
90
- FORCE_COLOR: 0
91
- },
92
- timeout: options.smokeTestTimeout
93
- });
94
- return Promise.resolve(util.exec(executable, args, stdioOptions)).catch(onSmokeTestError(smokeTestCommand, linuxWithDisplayEnv)).then(result => {
95
- // TODO: when execa > 1.1 is released
96
- // change this to `result.all` for both stderr and stdout
97
- // use lodash to be robust during tests against null result or missing stdout
98
- const smokeTestStdout = _.get(result, 'stdout', '');
99
- debug('smoke test stdout "%s"', smokeTestStdout);
100
- if (!util.stdoutLineMatches(String(random), smokeTestStdout)) {
101
- debug('Smoke test failed because could not find %d in:', random, result);
102
- const smokeTestStderr = _.get(result, 'stderr', '');
103
- const errorText = smokeTestStderr || smokeTestStdout;
104
- return throwFormErrorText(errors.smokeTestFailure(smokeTestCommand, false))(errorText);
105
- }
106
- });
107
- };
108
- const spawnInXvfb = linuxWithDisplayEnv => {
109
- return xvfb.start().then(() => {
110
- return spawn(linuxWithDisplayEnv);
111
- }).finally(xvfb.stop);
112
- };
113
- const userFriendlySpawn = linuxWithDisplayEnv => {
114
- debug('spawning, should retry on display problem?', Boolean(linuxWithDisplayEnv));
115
- return spawn(linuxWithDisplayEnv).catch({
116
- code: 'INVALID_SMOKE_TEST_DISPLAY_ERROR'
117
- }, () => {
118
- return spawnInXvfb(linuxWithDisplayEnv);
119
- });
120
- };
121
- if (needsXvfb) {
122
- return spawnInXvfb();
123
- }
124
-
125
- // if we are on linux and there's already a DISPLAY
126
- // set, then we may need to rerun cypress after
127
- // spawning our own Xvfb server
128
- const linuxWithDisplayEnv = util.isPossibleLinuxWithIncorrectDisplay();
129
- return userFriendlySpawn(linuxWithDisplayEnv);
127
+ // if we are on linux and there's already a DISPLAY
128
+ // set, then we may need to rerun cypress after
129
+ // spawning our own Xvfb server
130
+ const linuxWithDisplayEnv = util_1.default.isPossibleLinuxWithIncorrectDisplay();
131
+ return userFriendlySpawn(linuxWithDisplayEnv);
130
132
  };
131
133
  function testBinary(version, binaryDir, options) {
132
- debug('running binary verification check', version);
133
-
134
- // if running from 'cypress verify', don't print this message
135
- if (!options.force) {
136
- logger.log(stripIndent`
137
- It looks like this is your first time using Cypress: ${chalk.cyan(version)}
134
+ debug('running binary verification check', version);
135
+ // if running from 'cypress verify', don't print this message
136
+ if (!options.force) {
137
+ logger_1.default.log((0, common_tags_1.stripIndent) `
138
+ It looks like this is your first time using Cypress: ${chalk_1.default.cyan(version)}
138
139
  `);
139
- }
140
- logger.log();
141
-
142
- // if we are running in CI then use
143
- // the verbose renderer else use
144
- // the default
145
- let renderer = util.isCi() ? verbose : 'default';
146
- if (logger.logLevel() === 'silent') renderer = 'silent';
147
- const rendererOptions = {
148
- renderer
149
- };
150
- const tasks = new Listr([{
151
- options: {
152
- title: util.titleize('Verifying Cypress can run', chalk.gray(binaryDir))
153
- },
154
- task: (ctx, task) => {
155
- debug('clearing out the verified version');
156
- return state.clearBinaryStateAsync(binaryDir).then(() => {
157
- return Promise.all([runSmokeTest(binaryDir, options), Promise.resolve().delay(1500) // good user experience
158
- ]);
159
- }).then(() => {
160
- debug('write verified: true');
161
- return state.writeBinaryVerifiedAsync(true, binaryDir);
162
- }).then(() => {
163
- util.setTaskTitle(task, util.titleize(chalk.green('Verified Cypress!'), chalk.gray(binaryDir)), rendererOptions.renderer);
164
- });
165
140
  }
166
- }], {
167
- rendererOptions
168
- });
169
- return tasks.run();
141
+ logger_1.default.log();
142
+ // if we are running in CI then use
143
+ // the verbose renderer else use
144
+ // the default
145
+ let renderer = util_1.default.isCi() ? VerboseRenderer_1.default : 'default';
146
+ // NOTE: under test we set the listr renderer to 'silent' in order to get deterministic snapshots
147
+ if (logger_1.default.logLevel() === 'silent' || options.listrRenderer)
148
+ renderer = 'silent';
149
+ const rendererOptions = {
150
+ renderer,
151
+ };
152
+ const tasks = new listr2_1.Listr([
153
+ {
154
+ title: util_1.default.titleize('Verifying Cypress can run', chalk_1.default.gray(binaryDir)),
155
+ task: (ctx, task) => {
156
+ debug('clearing out the verified version');
157
+ return state_1.default.clearBinaryStateAsync(binaryDir)
158
+ .then(() => {
159
+ return bluebird_1.default.all([
160
+ runSmokeTest(binaryDir, options),
161
+ bluebird_1.default.delay(1500), // good user experience
162
+ ]);
163
+ })
164
+ .then(() => {
165
+ debug('write verified: true');
166
+ return state_1.default.writeBinaryVerifiedAsync(true, binaryDir);
167
+ })
168
+ .then(() => {
169
+ util_1.default.setTaskTitle(task, util_1.default.titleize(chalk_1.default.green('Verified Cypress!'), chalk_1.default.gray(binaryDir)), rendererOptions.renderer);
170
+ });
171
+ },
172
+ },
173
+ ], rendererOptions);
174
+ return tasks.run();
170
175
  }
171
176
  const maybeVerify = (installedVersion, binaryDir, options) => {
172
- return state.getBinaryVerifiedAsync(binaryDir).then(isVerified => {
173
- debug('is Verified ?', isVerified);
174
- let shouldVerify = !isVerified;
175
-
176
- // force verify if options.force
177
- if (options.force) {
178
- debug('force verify');
179
- shouldVerify = true;
180
- }
181
- if (shouldVerify) {
182
- return testBinary(installedVersion, binaryDir, options).then(() => {
183
- if (options.welcomeMessage) {
184
- logger.log();
185
- logger.log('Opening Cypress...');
177
+ return state_1.default.getBinaryVerifiedAsync(binaryDir)
178
+ .then((isVerified) => {
179
+ debug('is Verified ?', isVerified);
180
+ let shouldVerify = !isVerified;
181
+ // force verify if options.force
182
+ if (options.force) {
183
+ debug('force verify');
184
+ shouldVerify = true;
186
185
  }
187
- });
188
- }
189
- });
186
+ if (shouldVerify) {
187
+ return testBinary(installedVersion, binaryDir, options)
188
+ .then(() => {
189
+ if (options.welcomeMessage) {
190
+ logger_1.default.log();
191
+ logger_1.default.log('Opening Cypress...');
192
+ }
193
+ });
194
+ }
195
+ });
190
196
  };
191
197
  const start = (options = {}) => {
192
- debug('verifying Cypress app');
193
- const packageVersion = util.pkgVersion();
194
- let binaryDir = state.getBinaryDir(packageVersion);
195
- _.defaults(options, {
196
- dev: false,
197
- force: false,
198
- welcomeMessage: true,
199
- smokeTestTimeout: VERIFY_TEST_RUNNER_TIMEOUT_MS,
200
- skipVerify: util.getEnv('CYPRESS_SKIP_VERIFY') === 'true'
201
- });
202
- if (options.skipVerify) {
203
- debug('skipping verification of the Cypress app');
204
- return Promise.resolve();
205
- }
206
- if (options.dev) {
207
- return runSmokeTest('', options);
208
- }
209
- const parseBinaryEnvVar = () => {
210
- const envBinaryPath = util.getEnv('CYPRESS_RUN_BINARY');
211
- debug('CYPRESS_RUN_BINARY exists, =', envBinaryPath);
212
- logger.log(stripIndent`
213
- ${chalk.yellow('Note:')} You have set the environment variable:
198
+ debug('verifying Cypress app');
199
+ const packageVersion = util_1.default.pkgVersion();
200
+ let binaryDir = state_1.default.getBinaryDir(packageVersion);
201
+ lodash_1.default.defaults(options, {
202
+ dev: false,
203
+ force: false,
204
+ welcomeMessage: true,
205
+ smokeTestTimeout: VERIFY_TEST_RUNNER_TIMEOUT_MS,
206
+ skipVerify: util_1.default.getEnv('CYPRESS_SKIP_VERIFY') === 'true',
207
+ });
208
+ if (options.skipVerify) {
209
+ debug('skipping verification of the Cypress app');
210
+ return bluebird_1.default.resolve();
211
+ }
212
+ if (options.dev) {
213
+ return runSmokeTest('', options);
214
+ }
215
+ const parseBinaryEnvVar = () => {
216
+ const envBinaryPath = util_1.default.getEnv('CYPRESS_RUN_BINARY');
217
+ debug('CYPRESS_RUN_BINARY exists, =', envBinaryPath);
218
+ logger_1.default.log((0, common_tags_1.stripIndent) `
219
+ ${chalk_1.default.yellow('Note:')} You have set the environment variable:
214
220
 
215
- ${chalk.white('CYPRESS_RUN_BINARY=')}${chalk.cyan(envBinaryPath)}
221
+ ${chalk_1.default.white('CYPRESS_RUN_BINARY=')}${chalk_1.default.cyan(envBinaryPath)}
216
222
 
217
223
  This overrides the default Cypress binary path used.
218
224
  `);
219
- logger.log();
220
- return util.isExecutableAsync(envBinaryPath).then(isExecutable => {
221
- debug('CYPRESS_RUN_BINARY is executable? :', isExecutable);
222
- if (!isExecutable) {
223
- return throwFormErrorText(errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))(stripIndent`
225
+ logger_1.default.log();
226
+ return util_1.default.isExecutableAsync(envBinaryPath)
227
+ .then((isExecutable) => {
228
+ debug('CYPRESS_RUN_BINARY is executable? :', isExecutable);
229
+ if (!isExecutable) {
230
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))((0, common_tags_1.stripIndent) `
224
231
  The supplied binary path is not executable
225
232
  `);
226
- }
227
- }).then(() => {
228
- return state.parseRealPlatformBinaryFolderAsync(envBinaryPath);
229
- }).then(envBinaryDir => {
230
- if (!envBinaryDir) {
231
- return throwFormErrorText(errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))();
232
- }
233
- debug('CYPRESS_RUN_BINARY has binaryDir:', envBinaryDir);
234
- binaryDir = envBinaryDir;
235
- }).catch({
236
- code: 'ENOENT'
237
- }, err => {
238
- return throwFormErrorText(errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))(err.message);
239
- });
240
- };
241
- return Promise.try(() => {
242
- debug('checking environment variables');
243
- if (util.getEnv('CYPRESS_RUN_BINARY')) {
244
- return parseBinaryEnvVar();
245
- }
246
- }).then(() => {
247
- return checkExecutable(binaryDir);
248
- }).tap(() => {
249
- return debug('binaryDir is ', binaryDir);
250
- }).then(() => {
251
- return state.getBinaryPkgAsync(binaryDir);
252
- }).then(pkg => {
253
- return state.getBinaryPkgVersion(pkg);
254
- }).then(binaryVersion => {
255
- if (!binaryVersion) {
256
- debug('no Cypress binary found for cli version ', packageVersion);
257
- return throwFormErrorText(errors.missingApp(binaryDir))(`
258
- Cannot read binary version from: ${chalk.cyan(state.getBinaryPkgPath(binaryDir))}
233
+ }
234
+ })
235
+ .then(() => {
236
+ return state_1.default.parseRealPlatformBinaryFolderAsync(envBinaryPath);
237
+ })
238
+ .then((envBinaryDir) => {
239
+ if (!envBinaryDir) {
240
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))();
241
+ }
242
+ debug('CYPRESS_RUN_BINARY has binaryDir:', envBinaryDir);
243
+ binaryDir = envBinaryDir;
244
+ })
245
+ .catch({ code: 'ENOENT' }, (err) => {
246
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.CYPRESS_RUN_BINARY.notValid(envBinaryPath))(err.message);
247
+ });
248
+ };
249
+ return bluebird_1.default.try(() => {
250
+ debug('checking environment variables');
251
+ if (util_1.default.getEnv('CYPRESS_RUN_BINARY')) {
252
+ return parseBinaryEnvVar();
253
+ }
254
+ })
255
+ .then(() => {
256
+ return checkExecutable(binaryDir);
257
+ })
258
+ .tap(() => {
259
+ return debug('binaryDir is ', binaryDir);
260
+ })
261
+ .then(() => {
262
+ return state_1.default.getBinaryPkgAsync(binaryDir);
263
+ })
264
+ .then((pkg) => {
265
+ return state_1.default.getBinaryPkgVersion(pkg);
266
+ })
267
+ .then((binaryVersion) => {
268
+ if (!binaryVersion) {
269
+ debug('no Cypress binary found for cli version ', packageVersion);
270
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.missingApp(binaryDir))(`
271
+ Cannot read binary version from: ${chalk_1.default.cyan(state_1.default.getBinaryPkgPath(binaryDir))}
259
272
  `);
260
- }
261
- debug(`Found binary version ${chalk.green(binaryVersion)} installed in: ${chalk.cyan(binaryDir)}`);
262
- if (binaryVersion !== packageVersion) {
263
- // warn if we installed with CYPRESS_INSTALL_BINARY or changed version
264
- // in the package.json
265
- logger.log(`Found binary version ${chalk.green(binaryVersion)} installed in: ${chalk.cyan(binaryDir)}`);
266
- logger.log();
267
- logger.warn(stripIndent`
273
+ }
274
+ debug(`Found binary version ${chalk_1.default.green(binaryVersion)} installed in: ${chalk_1.default.cyan(binaryDir)}`);
275
+ if (binaryVersion !== packageVersion) {
276
+ // warn if we installed with CYPRESS_INSTALL_BINARY or changed version
277
+ // in the package.json
278
+ logger_1.default.log(`Found binary version ${chalk_1.default.green(binaryVersion)} installed in: ${chalk_1.default.cyan(binaryDir)}`);
279
+ logger_1.default.log();
280
+ logger_1.default.warn((0, common_tags_1.stripIndent) `
268
281
 
269
282
 
270
- ${logSymbols.warning} Warning: Binary version ${chalk.green(binaryVersion)} does not match the expected package version ${chalk.green(packageVersion)}
283
+ ${log_symbols_1.default.warning} Warning: Binary version ${chalk_1.default.green(binaryVersion)} does not match the expected package version ${chalk_1.default.green(packageVersion)}
271
284
 
272
285
  These versions may not work properly together.
273
286
  `);
274
- logger.log();
275
- }
276
- return maybeVerify(binaryVersion, binaryDir, options);
277
- }).catch(err => {
278
- if (err.known) {
279
- throw err;
280
- }
281
- return throwFormErrorText(errors.unexpected)(err.stack);
282
- });
287
+ logger_1.default.log();
288
+ }
289
+ return maybeVerify(binaryVersion, binaryDir, options);
290
+ })
291
+ .catch((err) => {
292
+ if (err.known) {
293
+ throw err;
294
+ }
295
+ return (0, errors_1.throwFormErrorText)(errors_1.errors.unexpected)(err.stack);
296
+ });
283
297
  };
284
- const isLinuxLike = () => os.platform() !== 'win32';
285
-
298
+ const isLinuxLike = () => os_1.default.platform() !== 'win32';
286
299
  /**
287
300
  * Returns true if running on a system where Electron needs "--no-sandbox" flag.
288
301
  * @see https://crbug.com/638180
@@ -293,8 +306,8 @@ const isLinuxLike = () => os.platform() !== 'win32';
293
306
  * @see https://github.com/electron/electron/issues/17972
294
307
  */
295
308
  const needsSandbox = () => isLinuxLike();
296
- module.exports = {
297
- start,
298
- VERIFY_TEST_RUNNER_TIMEOUT_MS,
299
- needsSandbox
300
- };
309
+ exports.default = {
310
+ start,
311
+ needsSandbox,
312
+ VERIFY_TEST_RUNNER_TIMEOUT_MS,
313
+ };