Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (fs.existsSync(supportFilesFolderPath)) {
cypressConfig.supportFile = supportFilesFolderPath
}
if (userAgent) {
cypressConfig.userAgent = `"${userAgent}"`
} else if (userAgentAppend) {
cypressConfig.userAgent = `"${DEFAULT_USER_AGENT} ${userAgentAppend}"`
}
if (screenshotsOnError) {
cypressConfig.screenshotOnHeadlessFailure = true
cypressConfig.screenshotsFolder = SCREENSHOTS_FOLDER
}
resolveLazyNPMBin('cypress/bin/cypress', `cypress@${CYPRESS_VERSION}`)
.then(cypressBinPath =>
getSpawnPromise(cypressBinPath, [
gui ? 'open' : 'run',
'--config=' + objectToCommaString(cypressConfig),
'--project=' + CYPRESS_FOLDER_PATH
])
)
.catch(showError)
async deploy(dir = DEFAULT_DIR, {auth, environmentVars} = {}) {
const {deployName: name, nowToken: token} = this
const nowBinPath = await resolveLazyNPMBin('.bin/now', `now@${NOW_VERSION}`)
await getSpawnPromise(
nowBinPath,
getNowCommandArgs({name, token, dir, auth, environmentVars})
)
await this.deletePreviousDeployments(1)
return setAliasToLastDeploy(this.now, this.deployName)
}