You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
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>
This commit is contained in:
@@ -3,21 +3,28 @@ import testUtils, { GLOBAL } from '../test-utils';
|
||||
import { transformArguments } from './QUERYINDEX';
|
||||
|
||||
describe('QUERYINDEX', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('*'),
|
||||
['TS.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 Promise.all([
|
||||
client.ts.create('key', {
|
||||
LABELS: {
|
||||
label: 'value'
|
||||
}
|
||||
})
|
||||
]);
|
||||
await client.ts.create('key', {
|
||||
LABELS: {
|
||||
label: 'value'
|
||||
}
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
await client.ts.queryIndex('label=value'),
|
||||
|
Reference in New Issue
Block a user