@@ -12,14 +12,14 @@ const generateGraphProfileQueryTests: Record<string, any>[] = [
12
12
{ input : 'GRAPH.QUERY key "MATCH (n) RETURN n"' , output : 'graph.explain key "MATCH (n) RETURN n"' , type : ProfileQueryType . Explain } ,
13
13
{ input : 'graph.query key "MATCH (n) RETURN n"' , output : 'graph.profile key "MATCH (n) RETURN n"' , type : ProfileQueryType . Profile } ,
14
14
{ input : 'graph.query key "MATCH (n) RETURN n"' , output : 'graph.explain key "MATCH (n) RETURN n"' , type : ProfileQueryType . Explain } ,
15
+ { input : null , output : null , type : ProfileQueryType . Profile } ,
16
+ { input : null , output : null , type : ProfileQueryType . Explain } ,
15
17
]
16
18
17
19
describe ( 'generateGraphProfileQuery' , ( ) => {
18
-
19
20
generateGraphProfileQueryTests . forEach ( test => {
20
21
it ( `should be output: ${ test . output } for input: ${ test . input } and type: ${ test . type } ` , ( ) => {
21
22
const result = generateGraphProfileQuery ( test . input , test . type ) ;
22
-
23
23
expect ( result ) . toEqual ( test . output ) ;
24
24
} ) ;
25
25
} )
@@ -29,24 +29,24 @@ describe('generateGraphProfileQuery', () => {
29
29
const generateSearchProfileQueryTests : Record < string , any > [ ] = [
30
30
{ input : 'FT.SEARCH index tomatoes' , output : 'ft.profile index SEARCH QUERY tomatoes' , type : ProfileQueryType . Profile } ,
31
31
{ input : 'FT.AGGREGATE index tomatoes' , output : 'ft.profile index AGGREGATE QUERY tomatoes' , type : ProfileQueryType . Profile } ,
32
- { input : 'FT.SEARCH index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
32
+ { input : 'FT.SEARCH index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
33
33
{ input : 'FT.AGGREGATE index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
34
- { input : 'ft.search index tomatoes' , output : 'ft.profile index search QUERY tomatoes' , type : ProfileQueryType . Profile } ,
34
+ { input : 'ft.search index tomatoes' , output : 'ft.profile index search QUERY tomatoes' , type : ProfileQueryType . Profile } ,
35
35
{ input : 'ft.aggregate index tomatoes' , output : 'ft.profile index aggregate QUERY tomatoes' , type : ProfileQueryType . Profile } ,
36
- { input : 'ft.search index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
36
+ { input : 'ft.search index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
37
37
{ input : 'ft.aggregate index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
38
- { input : 'ft.SEARCH index tomatoes' , output : 'ft.profile index SEARCH QUERY tomatoes' , type : ProfileQueryType . Profile } ,
38
+ { input : 'ft.SEARCH index tomatoes' , output : 'ft.profile index SEARCH QUERY tomatoes' , type : ProfileQueryType . Profile } ,
39
39
{ input : 'ft.AGGREGATE index tomatoes' , output : 'ft.profile index AGGREGATE QUERY tomatoes' , type : ProfileQueryType . Profile } ,
40
- { input : 'ft.SEARCH index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
40
+ { input : 'ft.SEARCH index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
41
41
{ input : 'ft.AGGREGATE index tomatoes' , output : 'ft.explain index tomatoes' , type : ProfileQueryType . Explain } ,
42
+ { input : null , output : null , type : ProfileQueryType . Profile } ,
43
+ { input : null , output : null , type : ProfileQueryType . Explain } ,
42
44
]
43
45
44
46
describe ( 'generateSearchProfileQuery' , ( ) => {
45
-
46
47
generateSearchProfileQueryTests . forEach ( test => {
47
48
it ( `should be output: ${ test . output } for input: ${ test . input } and type: ${ test . type } ` , ( ) => {
48
49
const result = generateSearchProfileQuery ( test . input , test . type ) ;
49
-
50
50
expect ( result ) . toEqual ( test . output ) ;
51
51
} ) ;
52
52
} )
@@ -63,9 +63,9 @@ const generateProfileQueryForCommandTests: Record<string, any>[] = [
63
63
{ input : 'GRAPH.EXPLAIN key "MATCH (n) RETURN n"' , output : null , type : ProfileQueryType . Explain } ,
64
64
{ input : 'ft._LIST' , output : null , type : ProfileQueryType . Profile } ,
65
65
{ input : 'ft._LIST' , output : null , type : ProfileQueryType . Explain } ,
66
- { input : 'ft.profile index SEARCH QUERY tomatoes' , output : null , type : ProfileQueryType . Profile } ,
66
+ { input : 'ft.profile index SEARCH QUERY tomatoes' , output : null , type : ProfileQueryType . Profile } ,
67
67
{ input : 'ft.profile index AGGREGATE QUERY tomatoes' , output : null , type : ProfileQueryType . Explain } ,
68
- { input : 'ft.explain index tomatoes' , output : null , type : ProfileQueryType . Profile } ,
68
+ { input : 'ft.explain index tomatoes' , output : null , type : ProfileQueryType . Profile } ,
69
69
{ input : 'ft.explain index tomatoes' , output : null , type : ProfileQueryType . Explain } ,
70
70
]
71
71
describe ( 'generateProfileQueryForCommand' , ( ) => {
0 commit comments