You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
* Support all GEORADIUS Commands * move store bool to options * simplify transformReply for store commands * clean code Co-authored-by: leibale <leibale1998@gmail.com>
32 lines
1.2 KiB
TypeScript
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_WITH';
|
|
|
|
describe('GEORADIUSBYMEMBER WITH', () => {
|
|
it('transformArguments', () => {
|
|
const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER', 'key', 'member', '3', 'm', 'WITHDIST'];
|
|
expectedReply.preserve = ['WITHDIST'];
|
|
|
|
assert.deepEqual(
|
|
transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
|
|
expectedReply
|
|
);
|
|
});
|
|
|
|
testUtils.testWithClient('client.geoRadiusByMemberWith', async client => {
|
|
assert.deepEqual(
|
|
await client.geoRadiusByMemberWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
|
|
[]
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
testUtils.testWithCluster('cluster.geoRadiusByMemberWith', async cluster => {
|
|
assert.deepEqual(
|
|
await cluster.geoRadiusByMemberWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
|
|
[]
|
|
);
|
|
}, GLOBAL.CLUSTERS.OPEN);
|
|
});
|