From ea43b597507763ed5ad077c9d4bd642dc42372c6 Mon Sep 17 00:00:00 2001 From: Michael Withagen Date: Wed, 20 Feb 2019 19:06:27 +0100 Subject: [PATCH] fix(cypress task): Return error when tests fail Change resolve to cb to follow gulp standards. --- lib/resources/tasks/cypress.js | 6 +++--- lib/resources/tasks/cypress.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/resources/tasks/cypress.js b/lib/resources/tasks/cypress.js index 9133bfe58..abfa88ef4 100644 --- a/lib/resources/tasks/cypress.js +++ b/lib/resources/tasks/cypress.js @@ -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); } diff --git a/lib/resources/tasks/cypress.ts b/lib/resources/tasks/cypress.ts index 7dee63b5e..50c393286 100644 --- a/lib/resources/tasks/cypress.ts +++ b/lib/resources/tasks/cypress.ts @@ -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); }