File tree Expand file tree Collapse file tree 2 files changed +25
-14
lines changed
packages/time-series/lib/commands Expand file tree Collapse file tree 2 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,28 @@ import testUtils, { GLOBAL } from '../test-utils';
33import { transformArguments } from './QUERYINDEX' ;
44
55describe ( 'QUERYINDEX' , ( ) => {
6- it ( 'transformArguments' , ( ) => {
7- assert . deepEqual (
8- transformArguments ( '*' ) ,
9- [ 'TS.QUERYINDEX' , '*' ]
10- ) ;
6+ describe ( 'transformArguments' , ( ) => {
7+ it ( 'single filter' , ( ) => {
8+ assert . deepEqual (
9+ transformArguments ( '*' ) ,
10+ [ 'TS.QUERYINDEX' , '*' ]
11+ ) ;
12+ } ) ;
13+
14+ it ( 'multiple filters' , ( ) => {
15+ assert . deepEqual (
16+ transformArguments ( [ 'a=1' , 'b=2' ] ) ,
17+ [ 'TS.QUERYINDEX' , 'a=1' , 'b=2' ]
18+ ) ;
19+ } ) ;
1120 } ) ;
1221
1322 testUtils . testWithClient ( 'client.ts.queryIndex' , async client => {
14- await Promise . all ( [
15- client . ts . create ( 'key' , {
16- LABELS : {
17- label : 'value'
18- }
19- } )
20- ] ) ;
23+ await client . ts . create ( 'key' , {
24+ LABELS : {
25+ label : 'value'
26+ }
27+ } ) ;
2128
2229 assert . deepEqual (
2330 await client . ts . queryIndex ( 'label=value' ) ,
Original file line number Diff line number Diff line change 1+ import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands' ;
2+ import { pushVerdictArguments } from '@node-redis/client/dist/lib/commands/generic-transformers' ;
3+ import { Filter } from '.' ;
4+
15export const IS_READ_ONLY = true ;
26
3- export function transformArguments ( query : string ) : Array < string > {
4- return [ 'TS.QUERYINDEX' , query ] ;
7+ export function transformArguments ( filter : Filter ) : RedisCommandArguments {
8+ return pushVerdictArguments ( [ 'TS.QUERYINDEX' ] , filter ) ;
59}
610
711export declare function transformReply ( ) : Array < string > ;
You can’t perform that action at this time.
0 commit comments