Skip to content

Commit

Permalink
fix(cypress task): Return error when tests fail
Browse files Browse the repository at this point in the history
Change resolve to cb to follow gulp standards.
  • Loading branch information
michaelw85 committed Feb 20, 2019
1 parent 7fa7e9e commit ea43b59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/resources/tasks/cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/resources/tasks/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ea43b59

Please sign in to comment.