1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00
Files
node-redis/packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.spec.ts
Avital Fine 06c1d2c243 Support all GEORADIUS Commands (#2017)
* Support all GEORADIUS Commands

* move store bool to options

* simplify transformReply for store commands

* clean code

Co-authored-by: leibale <leibale1998@gmail.com>
2022-05-11 09:36:12 -04:00

32 lines
1.2 KiB
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { RedisCommandArguments } from '.';
import { GeoReplyWith } from './generic-transformers';
import { transformArguments } from './GEORADIUSBYMEMBER_RO_WITH';
describe('GEORADIUSBYMEMBER_RO WITH', () => {
it('transformArguments', () => {
const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm', 'WITHDIST'];
expectedReply.preserve = ['WITHDIST'];
assert.deepEqual(
transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
expectedReply
);
});
testUtils.testWithClient('client.geoRadiusByMemberRoWith', async client => {
assert.deepEqual(
await client.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
[]
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithCluster('cluster.geoRadiusByMemberRoWith', async cluster => {
assert.deepEqual(
await cluster.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
[]
);
}, GLOBAL.CLUSTERS.OPEN);
});