You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* 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>
35 lines
943 B
TypeScript
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);
|
|
});
|