Skip to content

Commit

Permalink
fix(test): Avoiding an UnhandledPromiseRejection
Browse files Browse the repository at this point in the history
This commit avoids an UnhandledPromiseRejectionWarning to be throwing
from `'Breaker resets after a configurable amount of time when multiple
jobs fail'` test.
  • Loading branch information
helio-frota committed Jul 16, 2020
1 parent 579a0f7 commit 196457f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ test(
const breaker = new CircuitBreaker(passFail,
{ errorThresholdPercentage: 1, resetTimeout });

breaker.fire(fails);
breaker.fire(fails).catch(_ => {});
breaker.fire(fails)
.catch(() => {
// Now the breaker should be open. Wait for reset and
Expand Down

0 comments on commit 196457f

Please sign in to comment.