Skip to content

Commit c4dc4b5

Browse files
fix cancel
1 parent 51c5cb0 commit c4dc4b5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

packages/jest-jasmine2/src/queue_runner.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,15 @@ function queueRunner(options: Options) {
7171
);
7272
};
7373

74-
return options.queueableFns.reduce(
75-
(promise, fn) => promise.then(() => mapper(fn)),
76-
Promise.resolve(),
77-
);
74+
return PCancelable.fn(onCancel => {
75+
onCancel(() => {
76+
token.cancel();
77+
});
78+
return options.queueableFns.reduce(
79+
(promise, fn) => promise.then(() => mapper(fn)),
80+
Promise.resolve(),
81+
);
82+
});
7883
}
7984

8085
module.exports = queueRunner;

0 commit comments

Comments
 (0)