1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Support COMMAND DOCS

This commit is contained in:
Avital-Fine
2022-03-16 14:27:33 +01:00
parent be51abe347
commit 4fa53a88b1
3 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './COMMAND_DOCS';
describe('COMMAND DOCS', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
it('transformArguments', () => {
assert.deepEqual(
transformArguments('SORT'),
['COMMAND', 'DOCS', 'SORT']
);
});
testUtils.testWithClient('client.commandDocs', async client => {
assert.deepEqual(
await client.commandDocs('sort'),
[[
'sort',
{
summary: 'Sort the elements in a list, set or sorted set',
since: '1.0.0',
group: 'generic',
complexity: 'O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N).',
history: null
}
]]
);
}, GLOBAL.SERVERS.OPEN);
});