diff --git a/cli/lib/download/utils.js b/cli/lib/download/utils.js index c1448c80f7..af63818e73 100644 --- a/cli/lib/download/utils.js +++ b/cli/lib/download/utils.js @@ -196,6 +196,10 @@ const logFailed = () => { log() } +const logWarning = (text) => { + log(chalk.yellow(`! ${text}`)) +} + function testVersion (version) { return writeVerifiedVersion(null) .then(runSmokeTest) @@ -244,9 +248,10 @@ const verify = (options = {}) => { if (!installedVersion) { return explainAndFail(errors.missingApp)(new Error('Missing install')) } else if (installedVersion !== packageVersion) { - // TODO does this fail if we installed with CYPRESS_VERSION ?! + // warn if we installed with CYPRESS_VERSION or changed version + // in the package.json const msg = `Installed version (${installedVersion}) does not match package version (${packageVersion})` - return explainAndFail(errors.versionMismatch)(new Error(msg)) + logWarning(msg) } }) .then(() => { diff --git a/cli/test/download/utils_spec.js b/cli/test/download/utils_spec.js index 8ebbefcb78..42eea3f81b 100644 --- a/cli/test/download/utils_spec.js +++ b/cli/test/download/utils_spec.js @@ -206,14 +206,14 @@ describe('utils', function () { }) }) - it('logs error and exits when installed version does not match package version', function () { + it('logs warning when installed version does not match package version', function () { return utils.writeInstalledVersion('bloop') .then(() => { return utils.verify() }) .then(() => { - expect(this.log).to.be.calledWith('Installed version does not match package version') - expect(process.exit).to.be.calledWith(1) + const warning = chalk.yellow('! Installed version (bloop) does not match package version (0.0.0)') + expect(this.log).to.be.calledWith(warning) }) })