Files
cypress/scripts/test-unique-npm-and-binary.js
Brian Mann 1d0b35bd47 Cli env var changes (#1734)
* wip [skip ci] update

* wip [skip ci] update test

* [skip ci] fix env var

* bump sinon, create helper utility to always throw when a stub is called without being given stubbed behavior

* update failing specs

* fix some error messages

* update snapshot

* warning -> note, add snapshot tests

* change snapshot os.release, test env vars
2018-05-19 15:37:52 -04:00

31 lines
743 B
JavaScript

const minimist = require('minimist')
const options = minimist(process.argv)
const la = require('lazy-ass')
const is = require('check-more-types')
const execa = require('execa')
const { getNameAndBinary } = require('./utils')
/* eslint-disable no-console */
const { npm, binary } = getNameAndBinary(process.argv)
la(is.unemptyString(npm), 'missing npm url')
la(is.unemptyString(binary), 'missing binary url')
console.log('testing NPM from', npm)
console.log('and binary from', binary)
const cwd = options.cwd || process.cwd()
console.log('in', cwd)
execa.shell(`npm install ${npm}`, {
cwd,
stdio: 'inherit',
env: {
CYPRESS_INSTALL_BINARY: binary,
},
})
.then(console.log)
.catch((e) => {
console.error(e)
process.exit(1)
})