You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-19 07:02:06 +03:00
v4.0.0-rc.2 (#1664)
* update workflows & README
* add .deepsource.toml
* fix client.quit, add error events on cluster, fix some "deepsource.io" warnings
* Release 4.0.0-rc.1
* add cluster.duplicate, add some tests
* fix #1650 - add support for Buffer in some commands, add GET_BUFFER command
* fix GET and GET_BUFFER return type
* update FAQ
* Update invalid code example in README.md (#1654)
* Update invalid code example in README.md
* Update README.md
Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
* fix #1652
* ref #1653 - better types
* better types
* fix 54124793ad
* Update GEOSEARCHSTORE.spec.ts
* fix #1660 - add support for client.HSET('key', 'field', 'value')
* upgrade dependencies, update README
* fix #1659 - add support for db-number in client options url
* fix README, remove unused import, downgrade typedoc & typedoc-plugin-markdown
* update client-configurations.md
* fix README
* add CLUSTER_SLOTS, add some tests
* fix "createClient with url" test with redis 5
* remove unused imports
* Release 4.0.0-rc.2
Co-authored-by: Richard Samuelsson <noobtoothfairy@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import { TestRedisServers, itWithClient, TestRedisClusters, itWithCluster } from '../test-utils';
|
||||
import { transformArguments } from './GEOPOS';
|
||||
import { transformArguments, transformReply } from './GEOPOS';
|
||||
|
||||
describe('GEOPOS', () => {
|
||||
describe('transformArguments', () => {
|
||||
@@ -19,11 +19,49 @@ describe('GEOPOS', () => {
|
||||
});
|
||||
});
|
||||
|
||||
itWithClient(TestRedisServers.OPEN, 'client.geoPos', async client => {
|
||||
assert.deepEqual(
|
||||
await client.geoPos('key', 'member'),
|
||||
[null]
|
||||
);
|
||||
describe('transformReply', () => {
|
||||
it('null', () => {
|
||||
assert.deepEqual(
|
||||
transformReply([null]),
|
||||
[null]
|
||||
);
|
||||
});
|
||||
|
||||
it('with member', () => {
|
||||
assert.deepEqual(
|
||||
transformReply([['1', '2']]),
|
||||
[{
|
||||
longitude: '1',
|
||||
latitude: '2'
|
||||
}]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('client.geoPos', () => {
|
||||
itWithClient(TestRedisServers.OPEN, 'null', async client => {
|
||||
assert.deepEqual(
|
||||
await client.geoPos('key', 'member'),
|
||||
[null]
|
||||
);
|
||||
});
|
||||
|
||||
itWithClient(TestRedisServers.OPEN, 'with member', async client => {
|
||||
const coordinates = {
|
||||
longitude: '-122.06429868936538696',
|
||||
latitude: '37.37749628831998194'
|
||||
};
|
||||
|
||||
await client.geoAdd('key', {
|
||||
member: 'member',
|
||||
...coordinates
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
await client.geoPos('key', 'member'),
|
||||
[coordinates]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
itWithCluster(TestRedisClusters.OPEN, 'cluster.geoPos', async cluster => {
|
||||
|
Reference in New Issue
Block a user