Skip to content

Commit

Permalink
fix cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Aug 22, 2017
1 parent 51c5cb0 commit c4dc4b5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/jest-jasmine2/src/queue_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@ function queueRunner(options: Options) {
);
};

return options.queueableFns.reduce(
(promise, fn) => promise.then(() => mapper(fn)),
Promise.resolve(),
);
return PCancelable.fn(onCancel => {
onCancel(() => {
token.cancel();
});
return options.queueableFns.reduce(
(promise, fn) => promise.then(() => mapper(fn)),
Promise.resolve(),
);
});
}

module.exports = queueRunner;

0 comments on commit c4dc4b5

Please sign in to comment.