Skip to content

Commit

Permalink
test(obliterate): add case for empty queue
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Nov 26, 2024
1 parent d10a2fe commit 36b9973
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_obliterate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ describe('Obliterate', function () {
expect(keys.length).to.be.eql(0);
});

it('should obliterate a queue which is empty but has had jobs in the past', async () => {
await queue.waitUntilReady();

const job = await queue.add('test', { foo: 'bar' });
await job.remove();

await queue.obliterate();

const client = await queue.client;
const keys = await client.keys(`${prefix}:${queue.name}:*`);
expect(keys.length).to.be.eql(0);
});

it('should obliterate a queue with jobs in different statuses', async () => {
await queue.waitUntilReady();

Expand Down

0 comments on commit 36b9973

Please sign in to comment.