1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

some more commands

This commit is contained in:
Leibale
2023-04-30 10:08:25 -04:00
parent 2c4dc95a44
commit 53b9397a78
8 changed files with 259 additions and 243 deletions

View File

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