Use assert.isRejected instead of custom assertRejects

This commit is contained in:
Evan Hahn 2021-12-13 11:38:40 -06:00 committed by GitHub
parent 683823a114
commit 43f843f9fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 26 deletions

View file

@ -13,7 +13,6 @@ import PQueue from 'p-queue';
import { JobError } from '../../jobs/JobError';
import { TestJobQueueStore } from './TestJobQueueStore';
import { missingCaseError } from '../../util/missingCaseError';
import { assertRejects } from '../helpers';
import type { LoggerType } from '../../types/Logging';
import { JobQueue } from '../../jobs/JobQueue';
@ -803,8 +802,8 @@ describe('JobQueue', () => {
noopQueue.streamJobs();
await assertRejects(() => noopQueue.streamJobs());
await assertRejects(() => noopQueue.streamJobs());
await assert.isRejected(noopQueue.streamJobs());
await assert.isRejected(noopQueue.streamJobs());
sinon.assert.calledOnce(fakeStore.stream as sinon.SinonStub);
});
@ -834,7 +833,7 @@ describe('JobQueue', () => {
maxAttempts: 99,
});
await assertRejects(() => noopQueue.add(undefined));
await assert.isRejected(noopQueue.add(undefined));
sinon.assert.notCalled(fakeStore.stream as sinon.SinonStub);
});