1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/lib/commands/RPUSHX.spec.ts

36 lines
1010 B
TypeScript

import { strict as assert } from 'assert';
import { TestRedisServers, itWithClient, itWithCluster, TestRedisClusters } from '../test-utils';
import { transformArguments } from './RPUSHX';
describe('RPUSHX', () => {
describe('transformArguments', () => {
it('string', () => {
assert.deepEqual(
transformArguments('key', 'element'),
['RPUSHX', 'key', 'element']
);
});
it('array', () => {
assert.deepEqual(
transformArguments('key', ['1', '2']),
['RPUSHX', 'key', '1', '2']
);
});
});
itWithClient(TestRedisServers.OPEN, 'client.rPushX', async client => {
assert.equal(
await client.rPushX('key', 'element'),
0
);
});
itWithCluster(TestRedisClusters.OPEN, 'cluster.rPushX', async cluster => {
assert.equal(
await cluster.rPushX('key', 'element'),
0
);
});
});