Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: TJ Zhang <[email protected]>
  • Loading branch information
TJ Zhang committed Jul 23, 2024
1 parent d1341f1 commit f0eef9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion node/src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3434,7 +3434,7 @@ export class BaseClient {
* ```
*/
public geohash(key: string, members: string[]): Promise<(string | null)[]> {
return this.createWritePromise<string[]>(
return this.createWritePromise<(string | null)[]>(
createGeoHash(key, members),
).then((hashes) =>
hashes.map((hash) => (hash === null ? null : "" + hash)),
Expand Down
3 changes: 3 additions & 0 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4567,12 +4567,15 @@ export function runBaseTests<Context>(config: {
new GeospatialData(15.087269, 37.502669),
);
expect(await client.geoadd(key1, membersToCoordinates)).toBe(2);

// checking result with default metric
expect(await client.geohash(key1, members)).toEqual(expected);

// empty members array
expect(await (await client.geohash(key1, empty)).length).toBe(
0,
);

// key exists but holds non-ZSET value
expect(await client.set(key2, "geohash")).toBe("OK");
await expect(client.geohash(key2, members)).rejects.toThrow();
Expand Down

0 comments on commit f0eef9d

Please sign in to comment.