1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00
This commit is contained in:
Leibale
2023-04-27 19:17:11 -04:00
parent ab3973aca3
commit 8d615e99ed
16 changed files with 490 additions and 431 deletions

View File

@@ -1,28 +1,31 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './SINTERSTORE';
import SINTERSTORE from './SINTERSTORE';
describe('SINTERSTORE', () => {
describe('transformArguments', () => {
it('string', () => {
assert.deepEqual(
transformArguments('destination', 'key'),
['SINTERSTORE', 'destination', 'key']
);
});
it('array', () => {
assert.deepEqual(
transformArguments('destination', ['1', '2']),
['SINTERSTORE', 'destination', '1', '2']
);
});
describe('transformArguments', () => {
it('string', () => {
assert.deepEqual(
SINTERSTORE.transformArguments('destination', 'key'),
['SINTERSTORE', 'destination', 'key']
);
});
testUtils.testWithClient('client.sInterStore', async client => {
assert.equal(
await client.sInterStore('destination', 'key'),
0
);
}, GLOBAL.SERVERS.OPEN);
it('array', () => {
assert.deepEqual(
SINTERSTORE.transformArguments('destination', ['1', '2']),
['SINTERSTORE', 'destination', '1', '2']
);
});
});
testUtils.testAll('sInterStore', async client => {
assert.equal(
await client.sInterStore('{tag}destination', '{tag}key'),
0
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
});