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

ember-chromium

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-chromium - npm Package Compare versions

Comparing version 4.0.0 to 4.0.2

23

download-chrome.js

@@ -94,15 +94,14 @@ #!/usr/bin/env node

module.exports = (function () {
return utils.getBinaryPath().then(({execPath, binPath, versionNumber }) => {
const exists = fs.existsSync(execPath);
const { execPath, binPath, versionNumber } = utils.getBinaryPath();
const exists = fs.existsSync(execPath);
if (exists) {
console.log('Chrome is already installed');
} else {
console.log('Chrome is not installed, triggering download');
return utils.getChromiumBranchingPoint(versionNumber)
.then(downloadChromiumRevision)
.then(path => unzipArchive(path, binPath))
.catch(err => console.error('An error occurred while trying to setup Chromium. Resolve all issues and restart the process', err));
}
});
if (exists) {
console.log('Chrome is already installed');
} else {
console.log('Chrome is not installed, triggering download');
return utils.getChromiumBranchingPoint(versionNumber)
.then(downloadChromiumRevision)
.then(path => unzipArchive(path, binPath))
.catch(err => console.error('An error occurred while trying to setup Chromium. Resolve all issues and restart the process', err));
}
})();

@@ -20,29 +20,28 @@ /* global require, module */

return utils.getBinaryPath().then(({execPath}) => {
if (!fs.existsSync(execPath)) {
console.error('Chromium does not appear to be installed, testem cannot run.'); // eslint-disable-line
process.exit(1); // for some reason this doesn't stop testem from continuing in server mode
throw new Error('Chromium not installed');
}
const { execPath } = utils.getBinaryPath();
if (!fs.existsSync(execPath)) {
console.error('Chromium does not appear to be installed, testem cannot run.'); // eslint-disable-line
process.exit(1); // for some reason this doesn't stop testem from continuing in server mode
throw new Error('Chromium not installed');
}
return {
test_page: 'tests/index.html?hidepassed',
browser_start_timeout: 60,
launchers: {
chromium: {
exe: execPath,
args: chromiumArgs,
protocol: 'browser'
},
chromium_headless: {
exe: execPath,
args: ['--headless', ...chromiumArgs],
protocol: 'browser'
}
return {
test_page: 'tests/index.html?hidepassed',
browser_start_timeout: 60,
launchers: {
chromium: {
exe: execPath,
args: chromiumArgs,
protocol: 'browser'
},
chromium_headless: {
exe: execPath,
args: ['--headless', ...chromiumArgs],
protocol: 'browser'
}
},
launch_in_ci: ['chromium_headless'],
launch_in_dev: ['chromium']
};
});
launch_in_ci: ['chromium_headless'],
launch_in_dev: ['chromium']
};
}

@@ -49,0 +48,0 @@

{
"name": "ember-chromium",
"version": "4.0.0",
"version": "4.0.2",
"description": "One place to hold all the logic to download and run ember tests in chromium",

@@ -9,3 +9,5 @@ "main": "index.js",

},
"publishConfig": { "registry": "https://registry.npmjs.org" },
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"scripts": {

@@ -12,0 +14,0 @@ "postinstall": "node download-chrome.js",

@@ -63,28 +63,34 @@ #!/usr/bin/env node

function getBinaryPath () {
return getExactChromeVersionNumber()
.then(versionNumber => {
const buffer = childProcess.execSync('npm bin -g');
const result = String.fromCharCode.apply(null, buffer);
const globalPath = result.replace(/\n$/, '');
let binPath = path.join(globalPath, 'ember-chromium', versionNumber);
let execPath;
// run async function synchronously because testem doesn't like async configs
// I'm not proud of this but it works.
const versionBuffer = childProcess.execSync(`
node -e "
require('ember-chromium/utils').getExactChromeVersionNumber()
.then(v => process.stdout.write(v))
"
`);
const versionNumber = String.fromCharCode.apply(null, versionBuffer);
const buffer = childProcess.execSync('npm bin -g');
const result = String.fromCharCode.apply(null, buffer);
const globalPath = result.replace(/\n$/, '');
let binPath = path.join(globalPath, 'ember-chromium', versionNumber);
let execPath;
const platform = process.platform;
const folderName = getOsChromiumFolderName();
const platform = process.platform;
const folderName = getOsChromiumFolderName();
if (platform === 'linux') {
execPath = path.join(binPath, folderName, 'chrome');
} else if (platform === 'win32') {
execPath = path.join(binPath, folderName, 'chrome.exe');
} else if (platform === 'darwin') {
execPath = path.join(binPath, folderName, 'Chromium.app/Contents/MacOS/Chromium');
} else {
console.error('Unsupported platform or architecture found:', process.platform, process.arch);
throw new Error('Unsupported platform');
}
if (platform === 'linux') {
execPath = path.join(binPath, folderName, 'chrome');
} else if (platform === 'win32') {
execPath = path.join(binPath, folderName, 'chrome.exe');
} else if (platform === 'darwin') {
execPath = path.join(binPath, folderName, 'Chromium.app/Contents/MacOS/Chromium');
} else {
console.error('Unsupported platform or architecture found:', process.platform, process.arch);
throw new Error('Unsupported platform');
}
console.log(`checking for chromium at: ${execPath.toString()}`);
console.log(`checking for chromium at: ${execPath.toString()}`);
return {binPath, execPath, versionNumber};
});
return {binPath, execPath, versionNumber};
}

@@ -134,3 +140,4 @@

getOsChromiumFolderName,
getChromiumBranchingPoint
getChromiumBranchingPoint,
getExactChromeVersionNumber
};
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