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

fix DEL spec

This commit is contained in:
dovi
2023-05-02 19:52:28 -04:00
parent 80ecd9e06a
commit ca90d51fb8
2 changed files with 27 additions and 21 deletions

View File

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

View File

@@ -42,6 +42,7 @@ import CLUSTER_MYID from './CLUSTER_MYID';
import CLUSTER_REPLICATE from './CLUSTER_REPLICATE';
import DECR from './DECR';
import DECRBY from './DECRBY';
import DEL from './DEL';
import DUMP from './DUMP';
import GET from './GET';
import GETDEL from './GETDEL';
@@ -270,6 +271,8 @@ export default {
decr: DECR,
DECRBY,
decrBy: DECRBY,
DEL,
del: DEL,
DUMP,
dump: DUMP,
GET,