diff --git a/lib/resources/tasks/jest.js b/lib/resources/tasks/jest.js index 3df63f960..9d4963e56 100644 --- a/lib/resources/tasks/jest.js +++ b/lib/resources/tasks/jest.js @@ -13,9 +13,9 @@ export default (cb) => { process.env.BABEL_TARGET = 'node'; - jest.runCLI(options, [path.resolve(__dirname, '../../')]).then((result) => { - if (result.numFailedTests || result.numFailedTestSuites) { - cb(new PluginError('gulp-jest', { message: 'Tests Failed' })); + jest.runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => { + if (results.numFailedTests || results.numFailedTestSuites) { + cb(new PluginError('jest-cli', { message: 'Tests Failed' })); } else { cb(); } diff --git a/lib/resources/tasks/jest.ts b/lib/resources/tasks/jest.ts index 9e490bfd0..067464aee 100644 --- a/lib/resources/tasks/jest.ts +++ b/lib/resources/tasks/jest.ts @@ -12,9 +12,9 @@ export default (cb) => { Object.assign(options, { watch: true}); } - jest.runCLI(options, [path.resolve(__dirname, '../../')]).then((result) => { - if(result.numFailedTests || result.numFailedTestSuites) { - cb(new PluginError('gulp-jest', { message: 'Tests Failed' })); + jest.runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => { + if (results.numFailedTests || results.numFailedTestSuites) { + cb(new PluginError('jest-cli', { message: 'Tests Failed' })); } else { cb(); }