1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Files
node-redis/packages/time-series/lib/commands/QUERYINDEX.spec.ts
2023-09-18 15:03:07 -04:00

35 lines
867 B
TypeScript

import { strict as assert } from 'node: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);
});