1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
This commit is contained in:
Leibale
2023-11-09 11:12:41 -05:00
parent 98970fab2e
commit a5a4cb45ea
15 changed files with 222 additions and 261 deletions

View File

@@ -1,11 +1,11 @@
import { strict as assert } from 'node:assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments, transformReply } from './CLUSTER_INFO';
import CLUSTER_INFO from './CLUSTER_INFO';
describe('CLUSTER INFO', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments(),
CLUSTER_INFO.transformArguments(),
['CLUSTER', 'INFO']
);
});

View File

@@ -1,20 +1,28 @@
import { strict as assert } from 'node:assert';
import { transformArguments } from './INFO';
import testUtils, { GLOBAL } from '../test-utils';
import INFO from './INFO';
describe('INFO', () => {
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
transformArguments(),
['INFO']
);
});
it('server section', () => {
assert.deepEqual(
transformArguments('server'),
['INFO', 'server']
);
});
describe('transformArguments', () => {
it('simple', () => {
assert.deepEqual(
INFO.transformArguments(),
['INFO']
);
});
it('server section', () => {
assert.deepEqual(
INFO.transformArguments('server'),
['INFO', 'server']
);
});
});
testUtils.testWithClient('client.info', async client => {
assert.equal(
typeof await client.info(),
'string'
);
}, GLOBAL.SERVERS.OPEN);
});

View File

@@ -2,13 +2,10 @@ import { strict as assert } from 'node:assert';
import testUtils, { GLOBAL } from '../test-utils';
describe('KEYS', () => {
testUtils.testAll('keys', async client => {
testUtils.testWithClient('keys', async client => {
assert.deepEqual(
await client.keys('pattern'),
[]
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
}, GLOBAL.SERVERS.OPEN);
});

View File

@@ -50,7 +50,7 @@ describe('SCAN', () => {
});
});
testUtils.testAll('scan', async client => {
testUtils.testWithClient('client.scan', async client => {
assert.deepEqual(
await client.scan('0'),
{
@@ -58,8 +58,5 @@ describe('SCAN', () => {
keys: []
}
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
}, GLOBAL.SERVERS.OPEN);
});

View File

@@ -10,13 +10,10 @@ describe('WAIT', () => {
);
});
testUtils.testAll('wait', async client => {
testUtils.testWithClient('client.wait', async client => {
assert.equal(
await client.wait(0, 1),
0
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
}, GLOBAL.SERVERS.OPEN);
});