Skip to content

Commit

Permalink
add assertions count on async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cadgerfeast committed Mar 9, 2021
1 parent ff17b47 commit c994cf8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/unit/module/bulkhead.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('Bulkhead', () => {
failureAsync.mockClear();
});
it('should add to concurrent buffer', async () => {
expect.assertions(6);
const bulkhead = new Mollitia.Bulkhead({
concurrentSize: 2,
queueSize: 2,
Expand Down
1 change: 1 addition & 0 deletions test/unit/module/ratelimit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('Ratelimit', () => {
failureAsync.mockClear();
});
it('With a single ratelimit', async () => {
expect.assertions(13);
const ratelimit = new Mollitia.Ratelimit({
limitPeriod: 1000,
limitForPeriod: 3,
Expand Down
2 changes: 2 additions & 0 deletions test/unit/module/retry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('Retry', () => {
expect(onEvent).toHaveBeenNthCalledWith(6, circuit); // Timeout
});
it('should retry every 100ms', async () => {
expect.assertions(5);
const retry = new Mollitia.Retry({
attempts: 2,
interval: 500
Expand All @@ -93,6 +94,7 @@ describe('Retry', () => {
expect(onRetry).toHaveBeenNthCalledWith(2, circuit, 2);
});
it('should allow to filter for rejections and set retry interval', async () => {
expect.assertions(7);
const retry = new Mollitia.Retry({
attempts: 2,
interval: 500,
Expand Down

0 comments on commit c994cf8

Please sign in to comment.