1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
node-redis/packages/client/lib/commands/SINTERCARD.spec.ts
Avital Fine 875298e6e3 Support ZINTERCARD and SINTERCARD (#2040)
* Support ZINTERCARD and SINTERCARD

* clean code

* clean code

Co-authored-by: leibale <leibale1998@gmail.com>
2022-03-20 13:40:19 -04:00

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);
});