From 36b99739a428cabdbd292fc38caf9780e286d84b Mon Sep 17 00:00:00 2001 From: Manuel Astudillo Date: Fri, 22 Nov 2024 10:16:18 +0100 Subject: [PATCH] test(obliterate): add case for empty queue --- tests/test_obliterate.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_obliterate.ts b/tests/test_obliterate.ts index 48967bd5df..2358bcf790 100644 --- a/tests/test_obliterate.ts +++ b/tests/test_obliterate.ts @@ -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();