You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
27 lines
740 B
TypeScript
27 lines
740 B
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../../test-utils';
|
|
import INFO from './INFO';
|
|
|
|
describe('TOPK INFO', () => {
|
|
it('transformArguments', () => {
|
|
assert.deepEqual(
|
|
INFO.transformArguments('key'),
|
|
['TOPK.INFO', 'key']
|
|
);
|
|
});
|
|
|
|
testUtils.testWithClient('client.topK.info', async client => {
|
|
const k = 3,
|
|
[, reply] = await Promise.all([
|
|
client.topK.reserve('key', 3),
|
|
client.topK.info('key')
|
|
]);
|
|
|
|
assert.equal(typeof reply, 'object');
|
|
assert.equal(reply.k, k);
|
|
assert.equal(typeof reply.width, 'number');
|
|
assert.equal(typeof reply.depth, 'number');
|
|
assert.equal(typeof reply.decay, 'number');
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|