1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Files
node-redis/packages/client/lib/commands/ZPOPMIN_COUNT.spec.ts
2023-09-18 15:03:07 -04:00

33 lines
748 B
TypeScript

import { strict as assert } from 'node:assert';
import testUtils, { GLOBAL } from '../test-utils';
import ZPOPMIN_COUNT from './ZPOPMIN_COUNT';
describe('ZPOPMIN COUNT', () => {
it('transformArguments', () => {
assert.deepEqual(
ZPOPMIN_COUNT.transformArguments('key', 1),
['ZPOPMIN', 'key', '1']
);
});
testUtils.testAll('zPopMinCount', async client => {
const members = [{
value: '1',
score: 1
}, {
value: '2',
score: 2
}];
const [ , reply] = await Promise.all([
client.zAdd('key', members),
client.zPopMinCount('key', members.length)
]);
assert.deepEqual(reply, members);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.SERVERS.OPEN
});
});