Skip to content
Permalink
Browse files

fix(cypress task): Return error when tests fail

Change resolve to cb to follow gulp standards.
  • Loading branch information...
michaelw85 committed Feb 20, 2019
1 parent 7fa7e9e commit ea43b597507763ed5ad077c9d4bd642dc42372c6
Showing with 6 additions and 6 deletions.
  1. +3 −3 lib/resources/tasks/cypress.js
  2. +3 −3 lib/resources/tasks/cypress.ts
@@ -2,12 +2,12 @@ import cypress from 'cypress';
import { CLIOptions } from 'aurelia-cli';
import config from '../../cypress.config';

export default (resolve) => {
export default (cb) => {
if (CLIOptions.hasFlag('run')) {
cypress
.run(config)
.then(results => (results.totalFailed === 0 ? resolve() : resolve('Run failed!')))
.catch(resolve);
.then(results => (results.totalFailed === 0 ? cb() : cb('Run failed!')))
.catch(cb);
} else {
cypress.open(config);
}
@@ -2,12 +2,12 @@ import * as cypress from 'cypress';
import { CLIOptions } from 'aurelia-cli';
import * as config from '../../cypress.config';

export default (resolve) => {
export default (cb) => {
if (CLIOptions.hasFlag('run')) {
cypress
.run(config)
.then(results => (results.totalFailed === 0 ? resolve() : resolve('Run failed!')))
.catch(resolve);
.then(results => (results.totalFailed === 0 ? cb() : cb('Run failed!')))
.catch(cb);
} else {
cypress.open(config);
}

0 comments on commit ea43b59

Please sign in to comment.
You can’t perform that action at this time.