You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-17 19:41:06 +03:00
30 lines
949 B
TypeScript
30 lines
949 B
TypeScript
import { strict as assert } from 'assert';
|
|
import { TestRedisServers, itWithClient } from '../test-utils';
|
|
import { transformArguments } from './XAUTOCLAIM_JUSTID';
|
|
|
|
describe('XAUTOCLAIM JUSTID', () => {
|
|
it('transformArguments', () => {
|
|
assert.deepEqual(
|
|
transformArguments('key', 'group', 'consumer', 1, '0-0'),
|
|
['XAUTOCLAIM', 'key', 'group', 'consumer', '1', '0-0', 'JUSTID']
|
|
);
|
|
});
|
|
|
|
itWithClient(TestRedisServers.OPEN, 'client.xAutoClaimJustId', async client => {
|
|
await Promise.all([
|
|
client.xGroupCreate('key', 'group', '$', {
|
|
MKSTREAM: true
|
|
}),
|
|
client.xGroupCreateConsumer('key', 'group', 'consumer'),
|
|
]);
|
|
|
|
assert.deepEqual(
|
|
await client.xAutoClaimJustId('key', 'group', 'consumer', 1, '0-0'),
|
|
{
|
|
nextId: '0-0',
|
|
messages: []
|
|
}
|
|
);
|
|
});
|
|
});
|