You've already forked node-redis
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:
@@ -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
|
||||
});
|
||||
});
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user