You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* Support ZINTERCARD and SINTERCARD * clean code * clean code Co-authored-by: leibale <leibale1998@gmail.com>
31 lines
856 B
TypeScript
31 lines
856 B
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import { transformArguments } from './SINTERCARD';
|
|
|
|
describe('SINTERCARD', () => {
|
|
testUtils.isVersionGreaterThanHook([7, 0]);
|
|
|
|
describe('transformArguments', () => {
|
|
it('simple', () => {
|
|
assert.deepEqual(
|
|
transformArguments(['1', '2']),
|
|
['SINTERCARD', '2', '1', '2']
|
|
);
|
|
});
|
|
|
|
it('with limit', () => {
|
|
assert.deepEqual(
|
|
transformArguments(['1', '2'], 1),
|
|
['SINTERCARD', '2', '1', '2', 'LIMIT', '1']
|
|
);
|
|
});
|
|
});
|
|
|
|
testUtils.testWithClient('client.sInterCard', async client => {
|
|
assert.deepEqual(
|
|
await client.sInterCard('key'),
|
|
0
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|