Permalink
Browse files

fix(jest): update usage of jest.runCli

jest.runCli returns a promise. This change updates the usage of jest.runCli to use the promise rather than pass in a callback which never will get executed.

closes #896
  • Loading branch information...
1hella committed Jun 26, 2018
1 parent 00ed997 commit 66799c04710d3ab1d962feb9ed137ce6bc95cab6
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/resources/tasks/jest.js
  2. +2 −2 lib/resources/tasks/jest.ts
@@ -13,7 +13,7 @@ export default (cb) => {
process.env.BABEL_TARGET = 'node';
jest.runCLI(options, [path.resolve(__dirname, '../../')], (result) => {
jest.runCLI(options, [path.resolve(__dirname, '../../')]).then((result) => {
if (result.numFailedTests || result.numFailedTestSuites) {
cb(new gutil.PluginError('gulp-jest', { message: 'Tests Failed' }));
} else {
@@ -12,11 +12,11 @@ export default (cb) => {
Object.assign(options, { watch: true});
}
jest.runCLI(options, [path.resolve(__dirname, '../../')], (result) => {
jest.runCLI(options, [path.resolve(__dirname, '../../')]).then((result) => {
if(result.numFailedTests || result.numFailedTestSuites) {
cb(new gutil.PluginError('gulp-jest', { message: 'Tests Failed' }));
} else {
cb();
}
});
};
};

0 comments on commit 66799c0

Please sign in to comment.