You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-17 19:41:06 +03:00
implement some GEO commands, improve scan generic transformer, expose RPUSHX
This commit is contained in:
35
lib/commands/GEOSEARCH.spec.ts
Normal file
35
lib/commands/GEOSEARCH.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import { TestRedisServers, itWithClient, TestRedisClusters, itWithCluster } from '../test-utils';
|
||||
import { transformArguments } from './GEOSEARCH';
|
||||
|
||||
describe('GEOSEARCH', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('key', 'member', {
|
||||
radius: 1,
|
||||
unit: 'm'
|
||||
}),
|
||||
['GEOSEARCH', 'key', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm']
|
||||
);
|
||||
});
|
||||
|
||||
itWithClient(TestRedisServers.OPEN, 'client.geoSearch', async client => {
|
||||
assert.deepEqual(
|
||||
await client.geoSearch('key', 'member', {
|
||||
radius: 1,
|
||||
unit: 'm'
|
||||
}),
|
||||
[]
|
||||
);
|
||||
});
|
||||
|
||||
itWithCluster(TestRedisClusters.OPEN, 'cluster.geoSearch', async cluster => {
|
||||
assert.deepEqual(
|
||||
await cluster.geoSearch('key', 'member', {
|
||||
radius: 1,
|
||||
unit: 'm'
|
||||
}),
|
||||
[]
|
||||
);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user