You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Support ZINTERCARD and SINTERCARD (#2040)
* Support ZINTERCARD and SINTERCARD * clean code * clean code Co-authored-by: leibale <leibale1998@gmail.com>
This commit is contained in:
30
packages/client/lib/commands/SINTERCARD.spec.ts
Normal file
30
packages/client/lib/commands/SINTERCARD.spec.ts
Normal file
@ -0,0 +1,30 @@
|
||||
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);
|
||||
});
|
Reference in New Issue
Block a user