You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
fix DEL spec
This commit is contained in:
@@ -1,28 +1,31 @@
|
|||||||
import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
import { transformArguments } from './DEL';
|
import DEL from './DEL';
|
||||||
|
|
||||||
describe('DEL', () => {
|
describe('DEL', () => {
|
||||||
describe('transformArguments', () => {
|
describe('transformArguments', () => {
|
||||||
it('string', () => {
|
it('string', () => {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
transformArguments('key'),
|
DEL.transformArguments('key'),
|
||||||
['DEL', 'key']
|
['DEL', 'key']
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('array', () => {
|
it('array', () => {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
transformArguments(['key1', 'key2']),
|
DEL.transformArguments(['key1', 'key2']),
|
||||||
['DEL', 'key1', 'key2']
|
['DEL', 'key1', 'key2']
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
testUtils.testWithClient('client.del', async client => {
|
testUtils.testAll('del', async client => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await client.del('key'),
|
await client.del('key'),
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
}, GLOBAL.SERVERS.OPEN);
|
}, {
|
||||||
|
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 CLUSTER_REPLICATE from './CLUSTER_REPLICATE';
|
||||||
import DECR from './DECR';
|
import DECR from './DECR';
|
||||||
import DECRBY from './DECRBY';
|
import DECRBY from './DECRBY';
|
||||||
|
import DEL from './DEL';
|
||||||
import DUMP from './DUMP';
|
import DUMP from './DUMP';
|
||||||
import GET from './GET';
|
import GET from './GET';
|
||||||
import GETDEL from './GETDEL';
|
import GETDEL from './GETDEL';
|
||||||
@@ -270,6 +271,8 @@ export default {
|
|||||||
decr: DECR,
|
decr: DECR,
|
||||||
DECRBY,
|
DECRBY,
|
||||||
decrBy: DECRBY,
|
decrBy: DECRBY,
|
||||||
|
DEL,
|
||||||
|
del: DEL,
|
||||||
DUMP,
|
DUMP,
|
||||||
dump: DUMP,
|
dump: DUMP,
|
||||||
GET,
|
GET,
|
||||||
|
Reference in New Issue
Block a user