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 EXISTS 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 './EXISTS';
|
||||
import EXISTS from './EXISTS';
|
||||
|
||||
describe('EXISTS', () => {
|
||||
describe('transformArguments', () => {
|
||||
it('string', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('key'),
|
||||
['EXISTS', 'key']
|
||||
);
|
||||
});
|
||||
|
||||
it('array', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments(['1', '2']),
|
||||
['EXISTS', '1', '2']
|
||||
);
|
||||
});
|
||||
describe('transformArguments', () => {
|
||||
it('string', () => {
|
||||
assert.deepEqual(
|
||||
EXISTS.transformArguments('key'),
|
||||
['EXISTS', 'key']
|
||||
);
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.exists', async client => {
|
||||
assert.equal(
|
||||
await client.exists('key'),
|
||||
0
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
it('array', () => {
|
||||
assert.deepEqual(
|
||||
EXISTS.transformArguments(['1', '2']),
|
||||
['EXISTS', '1', '2']
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
testUtils.testAll('exists', async client => {
|
||||
assert.equal(
|
||||
await client.exists('key'),
|
||||
0
|
||||
);
|
||||
}, {
|
||||
client: GLOBAL.SERVERS.OPEN,
|
||||
cluster: GLOBAL.CLUSTERS.OPEN
|
||||
});
|
||||
});
|
||||
|
@@ -92,6 +92,7 @@ import MGET from './MGET';
|
||||
import MSET from './MSET';
|
||||
import MSETNX from './MSETNX';
|
||||
import PERSIST from './PERSIST';
|
||||
import EXISTS from './EXISTS';
|
||||
import PEXPIRE from './PEXPIRE';
|
||||
import PEXPIREAT from './PEXPIREAT';
|
||||
import PEXPIRETIME from './PEXPIRETIME';
|
||||
@@ -366,6 +367,8 @@ export default {
|
||||
mSetNX: MSETNX,
|
||||
PERSIST,
|
||||
persist: PERSIST,
|
||||
EXISTS,
|
||||
exists: EXISTS,
|
||||
PEXPIRE,
|
||||
pExpire: PEXPIRE,
|
||||
PEXPIREAT,
|
||||
|
15
todo.md
15
todo.md
@@ -8,13 +8,15 @@
|
||||
- `ZREVRANGE`
|
||||
- `ZREVRANGEBYLEX`
|
||||
- `ZREVRANGEBYSCORE`
|
||||
- `ZREVRANGE WITHSCORE`
|
||||
- `ZRANK WITHSCORE`
|
||||
|
||||
|
||||
# waiting List
|
||||
- `ZREMRANGEBYRANK.ts`
|
||||
- `ZREMRANGEBYSCORE.ts`
|
||||
# waiting List categoreis
|
||||
- Generic
|
||||
- String
|
||||
- Hash
|
||||
- List
|
||||
- Set
|
||||
- Bitmap
|
||||
|
||||
# fot leiba
|
||||
- `BZMPOP.ts`
|
||||
@@ -23,7 +25,8 @@
|
||||
- `ZMPOP.ts`
|
||||
- `ZPOPMAX.ts`
|
||||
- `ZPOPMIN.ts`
|
||||
|
||||
- `ZREVRANGE WITHSCORE`
|
||||
- `ZRANK WITHSCORE`
|
||||
|
||||
# other
|
||||
|
||||
|
Reference in New Issue
Block a user