1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +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,26 +1,22 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './SETRANGE';
import SETRANGE from './SETRANGE';
describe('SETRANGE', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments('key', 0, 'value'),
['SETRANGE', 'key', '0', 'value']
);
});
it('transformArguments', () => {
assert.deepEqual(
SETRANGE.transformArguments('key', 0, 'value'),
['SETRANGE', 'key', '0', 'value']
);
});
testUtils.testWithClient('client.setRange', async client => {
assert.equal(
await client.setRange('key', 0, 'value'),
5
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithCluster('cluster.setRange', async cluster => {
assert.equal(
await cluster.setRange('key', 0, 'value'),
5
);
}, GLOBAL.CLUSTERS.OPEN);
testUtils.testAll('setRange', async client => {
assert.equal(
await client.setRange('key', 0, 'value'),
5
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
});