1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
node-redis/packages/time-series/lib/commands/QUERYINDEX.spec.ts
JamesGDiaz 6d6ec7e3e9 fix TS.QUERYINDEX with multiple filters (#1996)
* fix TS.QUERYINDEX with multiple filters

* Update QUERYINDEX.spec.ts

* Update QUERYINDEX.spec.ts

* Update QUERYINDEX.spec.ts

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-02-21 18:59:21 -05:00

35 lines
943 B
TypeScript

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