1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

some commands

This commit is contained in:
Leibale
2023-05-09 14:04:26 +03:00
parent a6c0d1dbb3
commit d59254e497
21 changed files with 295 additions and 235 deletions

View File

@@ -13,22 +13,36 @@ describe('ZUNION', () => {
);
});
it('keys (array)', () => {
it('keys (Array<string>)', () => {
assert.deepEqual(
ZUNION.transformArguments(['1', '2']),
['ZUNION', '2', '1', '2']
);
});
it('with WEIGHTS', () => {
it('key & weight', () => {
assert.deepEqual(
ZUNION.transformArguments('key', {
WEIGHTS: [1]
ZUNION.transformArguments({
key: 'key',
weight: 1
}),
['ZUNION', '1', 'key', 'WEIGHTS', '1']
);
});
it('keys & weights', () => {
assert.deepEqual(
ZUNION.transformArguments([{
key: 'a',
weight: 1
}, {
key: 'b',
weight: 2
}]),
['ZUNION', '2', 'a', 'b', 'WEIGHTS', '1', '2']
);
});
it('with AGGREGATE', () => {
assert.deepEqual(
ZUNION.transformArguments('key', {