You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
add CLUSTER_SLOTS, add some tests
This commit is contained in:
@@ -5,6 +5,7 @@ import RedisClient from './client';
|
||||
import { AbortError, ClientClosedError, ConnectionTimeoutError, WatchError } from './errors';
|
||||
import { defineScript } from './lua-script';
|
||||
import { spy } from 'sinon';
|
||||
import { RedisNetSocketOptions } from './socket';
|
||||
|
||||
export const SQUARE_SCRIPT = defineScript({
|
||||
NUMBER_OF_KEYS: 0,
|
||||
@@ -63,6 +64,34 @@ describe('Client', () => {
|
||||
TypeError
|
||||
);
|
||||
});
|
||||
|
||||
it('redis://localhost', () => {
|
||||
assert.deepEqual(
|
||||
RedisClient.parseURL('redis://localhost'),
|
||||
{
|
||||
socket: {
|
||||
host: 'localhost',
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('createClient with url', async () => {
|
||||
const client = RedisClient.create({
|
||||
url: `redis://localhost:${(TEST_REDIS_SERVERS[TestRedisServers.OPEN].socket as RedisNetSocketOptions)!.port!.toString()}/1`
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
try {
|
||||
assert.equal(
|
||||
(await client.clientInfo()).db,
|
||||
1
|
||||
);
|
||||
} finally {
|
||||
await client.disconnect();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('authentication', () => {
|
||||
|
Reference in New Issue
Block a user