1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-13 10:02:24 +03:00
Files
node-redis/lib/commands/HRANDFIELD.spec.ts
2021-05-25 13:02:15 -04:00

36 lines
983 B
TypeScript

import { strict as assert } from 'assert';
import { TestRedisServers, itWithClient } from '../test-utils';
import { transformArguments } from './HRANDFIELD';
describe('HRANDFIELD', () => {
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
transformArguments('key'),
['HRANDFIELD', 'key']
);
});
it('with count', () => {
assert.deepEqual(
transformArguments('key', 1),
['HRANDFIELD', 'key', '1']
);
});
it('with count & values', () => {
assert.deepEqual(
transformArguments('key', 1, true),
['HRANDFIELD', 'key', '1', 'WITHVALUES']
);
});
});
itWithClient(TestRedisServers.OPEN, 'client.hRandField', async client => {
assert.equal(
await client.hRandField('key'),
null
);
});
});