From 51f64bb9f0878025edeca97b8c466c7828fb5b46 Mon Sep 17 00:00:00 2001 From: piyush0049 Date: Tue, 28 Jul 2026 23:30:13 +0530 Subject: [PATCH] test(client): add message assertion test for XCLAIM JUSTID --- .../client/lib/commands/XCLAIM_JUSTID.spec.ts | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/client/lib/commands/XCLAIM_JUSTID.spec.ts b/packages/client/lib/commands/XCLAIM_JUSTID.spec.ts index d7bf9fdc70c..ea03045a56d 100644 --- a/packages/client/lib/commands/XCLAIM_JUSTID.spec.ts +++ b/packages/client/lib/commands/XCLAIM_JUSTID.spec.ts @@ -11,15 +11,23 @@ describe('XCLAIM JUSTID', () => { ); }); - // TODO: test with messages - testUtils.testWithClient('client.xClaimJustId', async client => { - const [, reply] = await Promise.all([ - client.xGroupCreate('key', 'group', '$', { - MKSTREAM: true - }), - client.xClaimJustId('key', 'group', 'consumer', 1, '0-0') - ]); + testUtils.testAll('xClaimJustId', async client => { + const message = { field: 'value' }; - assert.deepEqual(reply, []); - }, GLOBAL.SERVERS.OPEN); + await client.xGroupCreate('key', 'group', '$', { + MKSTREAM: true + }); + await client.xAdd('key', '1-0', message); + await client.xAdd('key', '2-0', message); + await client.xReadGroup('group', 'consumer1', { + key: 'key', + id: '>' + }); + const reply = await client.xClaimJustId('key', 'group', 'consumer2', 0, ['1-0', '2-0']); + + assert.deepEqual(reply, ['1-0', '2-0']); + }, { + client: GLOBAL.SERVERS.OPEN, + cluster: GLOBAL.CLUSTERS.OPEN + }); });