Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress

Package Overview
Dependencies
Maintainers
2
Versions
239
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

8

lib/cli.js

@@ -24,2 +24,3 @@ 'use strict';

if (this._allowUnknownOption) return;
logger.error();

@@ -92,2 +93,3 @@ logger.error(' error: unknown ' + type + ':', flag);

debug('printing Cypress version');
return require('./exec/versions').getVersions().then(function () {

@@ -138,2 +140,3 @@ var versions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

var options = _.extend(parsedOpts, defaultOpts);
require('./tasks/verify').start(options).catch(util.logErrorExit1);

@@ -146,2 +149,3 @@ });

}
cache[opts]();

@@ -163,2 +167,3 @@ });

var firstCommand = args[2];
if (!_.includes(knownCommands, firstCommand)) {

@@ -168,2 +173,3 @@ debug('unknown command %s', firstCommand);

program.outputHelp();
return util.exit(1);

@@ -179,3 +185,5 @@ }

}
debug('program parsing arguments');
return program.parse(args);

@@ -182,0 +190,0 @@ }

2

lib/cypress.js

@@ -18,2 +18,3 @@ 'use strict';

options = util.normalizeModuleOptions(options);
return _open.start(options);

@@ -37,2 +38,3 @@ },

}
return output;

@@ -39,0 +41,0 @@ });

14

lib/errors.js

@@ -6,3 +6,3 @@ 'use strict';

_templateObject3 = _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\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 ']),
_templateObject4 = _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 https://on.cypress.io/not-installed-ci-error\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 https://on.cypress.io/not-installed-ci-error\n ']),
_templateObject4 = _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 ']),
_templateObject5 = _taggedTemplateLiteral(['\n There was a problem spawning Xvfb.\n\n This is likely a problem with your system, permissions, or installation of Xvfb.\n '], ['\n There was a problem spawning Xvfb.\n\n This is likely a problem with your system, permissions, or installation of Xvfb.\n ']),

@@ -46,3 +46,3 @@ _templateObject6 = _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 '], ['\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 ']),

description: 'The Cypress App could not be unzipped.',
solution: stripIndent(_templateObject, issuesUrl)
solution: stripIndent(_templateObject, chalk.blue(issuesUrl))
};

@@ -67,3 +67,3 @@

description: 'The cypress npm package is installed, but the Cypress binary is missing.',
solution: stripIndent(_templateObject4, chalk.cyan(executable), util.getCacheDir(), util.getCacheDir())
solution: stripIndent(_templateObject4, chalk.cyan(executable), util.getCacheDir(), util.getCacheDir(), chalk.blue('https://on.cypress.io/not-installed-ci-error'))
};

@@ -79,3 +79,3 @@ };

description: 'Your system is missing the dependency: XVFB',
solution: stripIndent(_templateObject6, requiredDependenciesUrl)
solution: stripIndent(_templateObject6, chalk.blue(requiredDependenciesUrl))
};

@@ -86,3 +86,3 @@

// this message is too Linux specific
solution: stripIndent(_templateObject7, requiredDependenciesUrl)
solution: stripIndent(_templateObject7, chalk.blue(requiredDependenciesUrl))
};

@@ -102,3 +102,3 @@

description: 'An unexpected error occurred while verifying the Cypress executable.',
solution: stripIndent(_templateObject8, docsUrl, issuesUrl)
solution: stripIndent(_templateObject8, chalk.blue(docsUrl), chalk.blue(issuesUrl))
};

@@ -120,2 +120,3 @@

var properFormat = '**/' + state.getPlatformExecutable();
return {

@@ -168,2 +169,3 @@ description: 'Could not run binary set by environment variable CYPRESS_RUN_BINARY=' + value,

var err = new Error(text);
err.known = true;

@@ -170,0 +172,0 @@ throw err;

@@ -98,2 +98,3 @@ 'use strict';

var child = cp.spawn(executable, args, options);
child.on('close', resolve);

@@ -145,6 +146,6 @@ child.on('error', reject);

return xvfb.start().then(userFriendlySpawn).finally(xvfb.stop);
} else {
return userFriendlySpawn();
}
return userFriendlySpawn();
}
};

@@ -19,2 +19,3 @@ 'use strict';

var envBinaryPath = path.resolve(util.getEnv('CYPRESS_RUN_BINARY'));
return state.parseRealPlatformBinaryFolderAsync(envBinaryPath).then(function (envBinaryDir) {

@@ -24,2 +25,3 @@ if (!envBinaryDir) {

}
debug('CYPRESS_RUN_BINARY has binaryDir:', envBinaryDir);

@@ -32,2 +34,3 @@

}
return state.getBinaryDir();

@@ -34,0 +37,0 @@ }).then(state.getBinaryPkgVersionAsync).then(function (binaryVersion) {

@@ -30,2 +30,3 @@ 'use strict';

debug('Starting XVFB');
return xvfb.startAsync().catch({ nonZeroExitCode: true }, throwFormErrorText(errors.nonZeroExitCodeXvfb)).catch(function (err) {

@@ -41,2 +42,3 @@ if (err.known) {

debug('Stopping XVFB');
return xvfb.stopAsync();

@@ -53,2 +55,3 @@ },

debug('Could not verify xvfb: %s', err.message);
return false;

@@ -55,0 +58,0 @@ }).finally(xvfb.stopAsync);

@@ -27,2 +27,3 @@ 'use strict';

if (logLevel() === 'silent') return;
logs.push(messages.join(' '));

@@ -40,2 +41,3 @@ console.log(chalk.yellow.apply(chalk, messages)); // eslint-disable-line no-console

if (logLevel() === 'silent' || logLevel() === 'warn') return;
logs.push(messages.join(' '));

@@ -49,2 +51,3 @@ (_console = console).log.apply(_console, messages); // eslint-disable-line no-console

var lines = text.split('\n');
R.forEach(log, lines);

@@ -51,0 +54,0 @@ };

@@ -10,2 +10,3 @@ 'use strict';

logger.log(state.getCacheDir());
return undefined;

@@ -12,0 +13,0 @@ };

@@ -30,8 +30,23 @@ 'use strict';

var baseUrl = 'https://download.cypress.io/';
var defaultBaseUrl = 'https://download.cypress.io/';
var getBaseUrl = function getBaseUrl() {
if (util.getEnv('CYPRESS_DOWNLOAD_MIRROR')) {
var baseUrl = util.getEnv('CYPRESS_DOWNLOAD_MIRROR');
if (!baseUrl.endsWith('/')) {
baseUrl += '/';
}
return baseUrl;
}
return defaultBaseUrl;
};
var prepend = function prepend(urlPath) {
var endpoint = url.resolve(baseUrl, urlPath);
var endpoint = url.resolve(getBaseUrl(), urlPath);
var platform = os.platform();
var arch = os.arch();
return endpoint + '?platform=' + platform + '&arch=' + arch;

@@ -43,4 +58,6 @@ };

debug('version is already an url', version);
return version;
}
return version ? prepend('desktop/' + version) : prepend('desktop');

@@ -55,2 +72,3 @@ };

var msg = stripIndent(_templateObject, getUrl(version), statusMessage(err));
debug(msg);

@@ -79,2 +97,3 @@

var version = response.headers['x-version'];
debug('redirect version:', version);

@@ -138,2 +157,3 @@ if (version) {

}
if (!progress) {

@@ -146,2 +166,3 @@ progress = { onProgress: function onProgress() {

var url = getUrl(version);
progress.throttle = 100;

@@ -148,0 +169,0 @@

@@ -86,2 +86,3 @@ 'use strict';

if (redirectVersion) version = redirectVersion;
debug('finished downloading file: ' + downloadDestination);

@@ -104,2 +105,3 @@ }).then(function () {

debug('removing zip file %s', downloadDestination);
return fs.removeAsync(downloadDestination);

@@ -141,2 +143,3 @@ };

var needVersion = pkgVersion;
debug('version in package.json is', needVersion);

@@ -148,2 +151,3 @@

var envVarVersion = util.getEnv('CYPRESS_INSTALL_BINARY');
debug('using environment variable CYPRESS_INSTALL_BINARY %s', envVarVersion);

@@ -155,2 +159,3 @@

logger.log();
return Promise.resolve();

@@ -170,2 +175,3 @@ }

var envCache = util.getEnv('CYPRESS_CACHE_FOLDER');
logger.log(stripIndent(_templateObject4, chalk.yellow('Note:'), chalk.cyan(envCache)));

@@ -187,2 +193,3 @@ logger.log();

debug('no binary installed under cli version');
return true;

@@ -199,2 +206,3 @@ }

debug('performing force install over existing binary');
return true;

@@ -206,2 +214,3 @@ }

alreadyInstalledMsg();
return false;

@@ -215,2 +224,3 @@ }

debug('Not downloading or installing binary');
return;

@@ -231,2 +241,3 @@ }

var possibleFile = util.formAbsolutePath(needVersion);
debug('checking local file', possibleFile, 'cwd', process.cwd());

@@ -240,2 +251,3 @@

}
return false;

@@ -246,2 +258,3 @@ });

var absolutePath = path.resolve(needVersion);
debug('found local file at', absolutePath);

@@ -251,2 +264,3 @@ debug('skipping download');

var rendererOptions = getRendererOptions();
return new Listr([unzipTask({

@@ -271,2 +285,3 @@ progress: {

var downloadDir = os.tmpdir();
return downloadAndUnzip({ version: needVersion, installDir: installDir, downloadDir: downloadDir });

@@ -290,2 +305,3 @@ })

rendererOptions = _ref2.rendererOptions;
return {

@@ -321,5 +337,7 @@ title: util.titleize('Unzipping Cypress'),

var renderer = util.isCi() ? verbose : 'default';
if (logger.logLevel() === 'silent') {
renderer = 'silent';
}
return {

@@ -326,0 +344,0 @@ renderer: renderer

@@ -13,2 +13,3 @@ 'use strict';

var platform = os.platform();
switch (platform) {

@@ -29,2 +30,3 @@ case 'darwin':

var platform = os.platform();
switch (platform) {

@@ -45,2 +47,3 @@ case 'darwin':

var platform = os.platform();
switch (platform) {

@@ -76,7 +79,10 @@ case 'darwin':

var cache_directory = util.getCacheDir();
if (util.getEnv('CYPRESS_CACHE_FOLDER')) {
var envVarCacheDir = util.getEnv('CYPRESS_CACHE_FOLDER');
debug('using environment variable CYPRESS_CACHE_FOLDER %s', envVarCacheDir);
cache_directory = path.resolve(envVarCacheDir);
}
return cache_directory;

@@ -91,5 +97,7 @@ };

}
if (os.platform() === 'darwin') {
return path.resolve(realPath, '..', '..', '..');
}
return path.resolve(realPath, '..');

@@ -110,2 +118,3 @@ });

debug('could not read binary_state.json file');
return {};

@@ -138,3 +147,5 @@ });

var pathToPackageJson = getBinaryPkgPath(binaryDir);
debug('Reading binary package.json from:', pathToPackageJson);
return fs.pathExistsAsync(pathToPackageJson).then(function (exists) {

@@ -144,2 +155,3 @@ if (!exists) {

}
return fs.readJsonAsync(pathToPackageJson).get('version');

@@ -146,0 +158,0 @@ });

@@ -38,2 +38,3 @@ 'use strict';

if (err) return reject(err);
// debug('zipfile.paths:', zipFile)

@@ -94,9 +95,6 @@ // zipFile.on('entry', debug)

var sp = cp.spawn('ditto', ['-xkV', zipFilePath, installDir]);
sp.on('error', function () {
return (
// f-it just unzip with node
unzipWithNode()
);
});
// f-it just unzip with node
sp.on('error', unzipWithNode);
sp.on('close', function (code) {

@@ -144,5 +142,7 @@ if (code === 0) {

la(is.unemptyString(installDir), 'missing installDir');
if (!progress) progress = { onProgress: function onProgress() {
return {};
} };
if (!progress) {
progress = { onProgress: function onProgress() {
return {};
} };
}

@@ -152,2 +152,3 @@ return fs.pathExists(installDir).then(function (exists) {

debug('removing existing unzipped binary', installDir);
return fs.removeAsync(installDir);

@@ -154,0 +155,0 @@ }

@@ -35,3 +35,5 @@ 'use strict';

var executable = state.getPathToExecutable(binaryDir);
debug('checking if executable exists', executable);
return util.isExecutableAsync(executable).then(function (isExecutable) {

@@ -46,2 +48,3 @@ debug('Binary is executable? :', isExecutable);

}
return throwFormErrorText(errors.missingApp(binaryDir))(stripIndent(_templateObject, chalk.cyan(executable)));

@@ -54,2 +57,3 @@ });

var cypressExecPath = state.getPathToExecutable(binaryDir);
debug('using Cypress executable %s', cypressExecPath);

@@ -59,2 +63,3 @@

debug('caught xvfb error %s', err.message);
return throwFormErrorText(errors.missingXvfb)('Caught error trying to run XVFB: "' + err.message + '"');

@@ -65,2 +70,3 @@ };

debug('Smoke test failed:', err);
return throwFormErrorText(errors.missingDependency)(err.stderr || err.message);

@@ -70,2 +76,3 @@ };

var needsXvfb = xvfb.isNeeded();
debug('needs XVFB?', needsXvfb);

@@ -77,2 +84,3 @@

var smokeTestCommand = cypressExecPath + ' ' + args.join(' ');
debug('smoke test command:', smokeTestCommand);

@@ -82,2 +90,3 @@

var smokeTestReturned = result.stdout;
debug('smoke test stdout "%s"', smokeTestReturned);

@@ -96,5 +105,5 @@

});
} else {
return spawn();
}
return spawn();
};

@@ -113,2 +122,3 @@

var renderer = util.isCi() ? verbose : 'default';
if (logger.logLevel() === 'silent') renderer = 'silent';

@@ -124,2 +134,3 @@

debug('clearing out the verified version');
return state.clearBinaryStateAsync(binaryDir).then(function () {

@@ -130,2 +141,3 @@ return Promise.all([runSmokeTest(binaryDir), Promise.resolve().delay(1500)] // good user experience

debug('write verified: true');
return state.writeBinaryVerifiedAsync(true, binaryDir);

@@ -149,2 +161,3 @@ }).then(function () {

var shouldVerify = !isVerified;
// force verify if options.force

@@ -182,2 +195,3 @@ if (options.force) {

var envBinaryPath = util.getEnv('CYPRESS_RUN_BINARY');
debug('CYPRESS_RUN_BINARY exists, =', envBinaryPath);

@@ -198,2 +212,3 @@ logger.log(stripIndent(_templateObject4, chalk.yellow('Note:'), chalk.white('CYPRESS_RUN_BINARY='), chalk.cyan(envBinaryPath)));

}
debug('CYPRESS_RUN_BINARY has binaryDir:', envBinaryDir);

@@ -222,2 +237,3 @@

debug('no Cypress binary found for cli version ', packageVersion);
return throwFormErrorText(errors.missingApp(binaryDir))('\n Cannot read binary version from: ' + chalk.cyan(state.getBinaryPkgPath(binaryDir)) + '\n ');

@@ -224,0 +240,0 @@ }

@@ -38,2 +38,3 @@ 'use strict';

var lineMatches = R.equals(expectedLine);
return lines.some(lineMatches);

@@ -179,5 +180,5 @@ }

});
} else {
return os.release();
}
return os.release();
});

@@ -195,2 +196,3 @@ },

}
return path.join(process.cwd(), '..', '..', filename);

@@ -202,14 +204,21 @@ },

var packageConfigVar = process.env['npm_package_config_' + varName];
if (envVar) {
debug('Using ' + varName + ' from environment variable');
return envVar;
}
if (configVar) {
debug('Using ' + varName + ' from npm config');
return configVar;
}
if (packageConfigVar) {
debug('Using ' + varName + ' from package.json config');
return packageConfigVar;
}
return undefined;

@@ -216,0 +225,0 @@ },

{
"name": "cypress",
"version": "3.1.0",
"version": "3.1.1",
"main": "index.js",

@@ -29,3 +29,3 @@ "bin": {

"@types/chai-jquery": "1.1.35",
"@types/jquery": "3.2.16",
"@types/jquery": "3.3.6",
"@types/lodash": "4.14.87",

@@ -32,0 +32,0 @@ "@types/minimatch": "3.0.3",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc