1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-17 19:41:06 +03:00
Files
node-redis/lib/commands/GEOSEARCHSTORE.spec.ts
2021-07-19 16:59:40 -04:00

44 lines
1.4 KiB
TypeScript

import { strict as assert } from 'assert';
import { TestRedisServers, itWithClient, TestRedisClusters, itWithCluster, describeHandleMinimumRedisVersion } from '../test-utils';
import { transformArguments } from './GEOSEARCHSTORE';
describe('GEOSEARCHSTORE', () => {
describeHandleMinimumRedisVersion([6, 2]);
it('transformArguments', () => {
assert.deepEqual(
transformArguments('destination', 'source', 'member', {
radius: 1,
unit: 'm'
}, {
SORT: 'ASC',
COUNT: {
value: 1,
ANY: true
}
}),
['GEOSEARCHSTORE', 'destination', 'source', 'FROMMEMBER', 'member', 'BYRADIUS', '1', 'm', 'ASC', 'COUNT', '1', 'ANY']
);
});
itWithClient(TestRedisServers.OPEN, 'client.geoSearchStore', async client => {
assert.equal(
await client.geoSearchStore('source', 'destination', 'member', {
radius: 1,
unit: 'm'
}),
0
);
});
itWithCluster(TestRedisClusters.OPEN, 'cluster.geoSearchStore', async cluster => {
assert.equal(
await cluster.geoSearchStore('{tag}source', '{tag}destination', 'member', {
radius: 1,
unit: 'm'
}),
0
);
});
});