1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
node-redis/packages/time-series/lib/commands/QUERYINDEX.spec.ts
Leibale ff07bbf3d3 WIP
2023-07-27 11:23:34 -04:00

35 lines
862 B
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import QUERYINDEX from './QUERYINDEX';
describe('TS.QUERYINDEX', () => {
describe('transformArguments', () => {
it('single filter', () => {
assert.deepEqual(
QUERYINDEX.transformArguments('*'),
['TS.QUERYINDEX', '*']
);
});
it('multiple filters', () => {
assert.deepEqual(
QUERYINDEX.transformArguments(['a=1', 'b=2']),
['TS.QUERYINDEX', 'a=1', 'b=2']
);
});
});
testUtils.testWithClient('client.ts.queryIndex', async client => {
const [, reply] = await Promise.all([
client.ts.create('key', {
LABELS: {
label: 'value'
}
}),
client.ts.queryIndex('label=value')
]);
assert.deepEqual(reply, ['key']);
}, GLOBAL.SERVERS.OPEN);
});