Skip to content

Commit

Permalink
fix(jest): update usage of jest.runCli
Browse files Browse the repository at this point in the history
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 66799c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/resources/tasks/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/resources/tasks/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.