1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
This commit is contained in:
Leibale
2023-04-23 07:56:15 -04:00
parent 35d32e5b64
commit 9faa3e77c4
326 changed files with 14620 additions and 10931 deletions

View File

@@ -1,37 +1,31 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './PING';
import PING from './PING';
describe('PING', () => {
describe('transformArguments', () => {
it('default', () => {
assert.deepEqual(
transformArguments(),
['PING']
);
});
it('with message', () => {
assert.deepEqual(
transformArguments('message'),
['PING', 'message']
);
});
describe.only('PING', () => {
describe('transformArguments', () => {
it('default', () => {
assert.deepEqual(
PING.transformArguments(),
['PING']
);
});
describe('client.ping', () => {
testUtils.testWithClient('string', async client => {
assert.equal(
await client.ping(),
'PONG'
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithClient('buffer', async client => {
assert.deepEqual(
await client.ping(client.commandOptions({ returnBuffers: true })),
Buffer.from('PONG')
);
}, GLOBAL.SERVERS.OPEN);
it('with message', () => {
assert.deepEqual(
PING.transformArguments('message'),
['PING', 'message']
);
});
});
testUtils.testAll('ping', async client => {
assert.equal(
await client.ping(),
'PONG'
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
});