1
0
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:
dovi
2023-05-02 19:34:49 -04:00
parent 98c1a1d235
commit 6809365e98
3 changed files with 36 additions and 27 deletions

View File

@@ -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
});
});