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

fix XSETID

This commit is contained in:
dovi
2023-05-02 16:06:14 -04:00
parent 449d9c40ae
commit afa394e35d
4 changed files with 71 additions and 24 deletions

View File

@@ -0,0 +1,42 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import XSETID from './XSETID';
describe('XSETID', () => {
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
XSETID.transformArguments('key', '0-0'),
['XSETID', 'key', '0-0']
);
});
it('with ENTRIESADDED', () => {
assert.deepEqual(
XSETID.transformArguments('key', '0-0', {
ENTRIESADDED: 1
}),
['XSETID', 'key', '0-0', 'ENTRIESADDED', '1']
);
});
it('with MAXDELETEDID', () => {
assert.deepEqual(
XSETID.transformArguments('key', '0-0', {
MAXDELETEDID: '1-1'
}),
['XSETID', 'key', '0-0', 'MAXDELETEDID', '1-1']
);
});
});
testUtils.testAll('xSetId', async client => {
assert.deepEqual(
await client.xSetId('key', '0-0'),
[]
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
});