1
0
mirror of https://github.com/redis/node-redis.git synced 2025-09-11 18:50:46 +03:00

add support for options in a command function (.get, .set, ...), add support for the SELECT command, implement a couple of commands, fix client socket reconnection strategy, add support for using replicas (RO) in cluster, and more..

This commit is contained in:
leibale
2021-05-25 09:45:38 -04:00
parent 815481fc73
commit 1cf95693a9
23 changed files with 714 additions and 226 deletions

View File

@@ -1,12 +1,20 @@
import { strict as assert } from 'assert';
import RedisClient from '../client';
import { TestRedisServers, itWithClient } from '../test-utils';
import { transformArguments } from './DEL';
describe('DEL', () => {
describe('transformArguments', () => {
it('multiple keys', () => {
it('string', () => {
assert.deepEqual(
transformArguments('key1', 'key2'),
transformArguments('key'),
['DEL', 'key']
);
});
it('array', () => {
assert.deepEqual(
transformArguments(['key1', 'key2']),
['DEL', 'key1', 'key2']
);
});
@@ -14,7 +22,7 @@ describe('DEL', () => {
itWithClient(TestRedisServers.OPEN, 'client.del', async client => {
assert.equal(
await client.del('key1', 'key2'),
await client.del('key'),
0
);
});