1
- import { parseSearchRawResponse , parseInfoRawResponse , parseAggregateRawResponse } from '../' ;
1
+ import { parseSearchRawResponse , parseInfoRawResponse , parseAggregateRawResponse } from '..'
2
2
3
3
const resultFTSearch : any [ ] = [
4
4
'red:2' ,
@@ -23,27 +23,27 @@ const resultFTSearch: any[] = [
23
23
'visits' ,
24
24
'108' ,
25
25
] ,
26
- ] ;
26
+ ]
27
27
28
- const resultFTSearchNoContent : any [ ] = [ 'red:2' , 'red:3' , 'red:4' , 'red:5' , 'red:6' ] ;
28
+ const resultFTSearchNoContent : any [ ] = [ 'red:2' , 'red:3' , 'red:4' , 'red:5' , 'red:6' ]
29
29
30
30
describe ( 'parseSearchRawResponse' , ( ) => {
31
31
it ( 'command "get" should return result is not modified 1' , ( ) => {
32
- const command = 'get' ;
33
- const result : any [ ] = [ ] ;
32
+ const command = 'get'
33
+ const result : any [ ] = [ ]
34
34
35
- expect ( parseSearchRawResponse ( command , result ) ) . toEqual ( result ) ;
36
- } ) ;
35
+ expect ( parseSearchRawResponse ( command , result ) ) . toEqual ( result )
36
+ } )
37
37
38
38
it ( 'command "get" should return result is not modified 2' , ( ) => {
39
- const command = 'get' ;
39
+ const command = 'get'
40
40
const result : any = [ ]
41
41
42
- expect ( parseSearchRawResponse ( command , result ) ) . toEqual ( result ) ;
43
- } ) ;
42
+ expect ( parseSearchRawResponse ( command , result ) ) . toEqual ( result )
43
+ } )
44
44
45
45
it ( 'command "ft.search" should return array with parsed object' , ( ) => {
46
- const command = 'ft.search' ;
46
+ const command = 'ft.search'
47
47
const parsedResultFTSearch = [
48
48
{
49
49
Doc : 'red:2' ,
@@ -59,13 +59,13 @@ describe('parseSearchRawResponse', () => {
59
59
url : '<https://redis.com/primary-caching>' ,
60
60
visits : '108' ,
61
61
} ,
62
- ] ;
62
+ ]
63
63
64
- expect ( parseSearchRawResponse ( command , resultFTSearch ) ) . toEqual ( parsedResultFTSearch ) ;
65
- } ) ;
64
+ expect ( parseSearchRawResponse ( command , resultFTSearch ) ) . toEqual ( parsedResultFTSearch )
65
+ } )
66
66
67
67
it ( 'command "ft.search" with attr NOCONTENT should return array of doc names' , ( ) => {
68
- const command = 'ft.search NOCONTENT' ;
68
+ const command = 'ft.search NOCONTENT'
69
69
const parsedResultFTSearch = [
70
70
{
71
71
Doc : 'red:2' ,
@@ -82,19 +82,17 @@ describe('parseSearchRawResponse', () => {
82
82
{
83
83
Doc : 'red:6' ,
84
84
} ,
85
- ] ;
85
+ ]
86
86
87
- expect ( parseSearchRawResponse ( command , resultFTSearchNoContent ) ) . toEqual ( parsedResultFTSearch ) ;
88
- } ) ;
89
-
90
-
91
- } ) ;
87
+ expect ( parseSearchRawResponse ( command , resultFTSearchNoContent ) ) . toEqual ( parsedResultFTSearch )
88
+ } )
89
+ } )
92
90
93
91
describe ( 'parseAggregateRawResponse' , ( ) => {
94
92
it ( 'command "ft.aggregate" should return array of array with objects count of docs ' , ( ) => {
95
- const command = 'ft.aggregate' ;
96
- const resultFTAggregate = [ [ ] , [ ] , [ ] , [ ] , [ ] ] ;
93
+ const command = 'ft.aggregate'
94
+ const resultFTAggregate = [ [ ] , [ ] , [ ] , [ ] , [ ] ]
97
95
98
- expect ( parseAggregateRawResponse ( resultFTAggregate ) ) . toEqual ( resultFTAggregate ) ;
99
- } ) ;
100
- } ) ;
96
+ expect ( parseAggregateRawResponse ( resultFTAggregate ) ) . toEqual ( resultFTAggregate )
97
+ } )
98
+ } )
0 commit comments