1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/lib/commands/COMMAND.spec.ts

31 lines
987 B
TypeScript

import { strict as assert } from 'assert';
import { itWithClient, TestRedisServers } from '../test-utils';
import { transformArguments } from './COMMAND';
import { CommandCategories, CommandFlags } from './generic-transformers';
describe('COMMAND', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments(),
['COMMAND']
);
});
itWithClient(TestRedisServers.OPEN, 'client.command', async client => {
assert.deepEqual(
(await client.command()).find(command => command.name === 'ping'),
{
name: 'ping',
arity: -1,
flags: new Set([CommandFlags.STALE, CommandFlags.FAST]),
firstKeyIndex: 0,
lastKeyIndex: 0,
step: 0,
categories: new Set([CommandCategories.FAST, CommandCategories.CONNECTION])
}
);
}, {
minimumRedisVersion: [6]
});
});