Use assert.isRejected
instead of custom assertRejects
This commit is contained in:
parent
683823a114
commit
43f843f9fc
3 changed files with 7 additions and 26 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue