Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (env) {
options.env = env;
}
if (spec) {
options.spec = spec;
}
options.exit = exit;
options.headed = !headless;
options.record = record;
options.key = key;
options.parallel = parallel;
options.ciBuildId = ciBuildId;
return fromPromise(
!isWatching || headless ? Cypress.run(options) : Cypress.open(options)
).pipe(
// tap(() => (isWatching && !headless ? process.exit() : null)), // Forcing `cypress.open` to give back the terminal
map(result => ({
/**
* `cypress.open` is returning `0` and is not of the same type as `cypress.run`.
* `cypress.open` is the graphical UI, so it will be obvious to know what wasn't
* working. Forcing the build to success when `cypress.open` is used.
*/
success: !result.totalFailed && !result.failures
}))
);
}
export default () => {
if (CLIOptions.hasFlag('run')) {
cypress.run(config);
} else {
cypress.open(config);
}
};
export default () => {
if (CLIOptions.hasFlag('run')) {
cypress.run(config);
} else {
cypress.open(config);
}
};