@@ -13,32 +13,22 @@ describe('ACL GETUSER', () => {
13
13
} ) ;
14
14
15
15
testUtils . testWithClient ( 'client.aclGetUser' , async client => {
16
- const expectedReply : any = {
17
- passwords : [ ] ,
18
- commands : '+@all' ,
19
- } ;
16
+ const reply = await client . aclGetUser ( 'default' ) ;
17
+
18
+ assert . ok ( Array . isArray ( reply . passwords ) ) ;
19
+ assert . equal ( typeof reply . commands , 'string' ) ;
20
+ assert . ok ( Array . isArray ( reply . flags ) ) ;
20
21
21
22
if ( testUtils . isVersionGreaterThan ( [ 7 ] ) ) {
22
- expectedReply . flags = [ 'on' , 'nopass' ] ;
23
- expectedReply . keys = '~*' ;
24
- expectedReply . channels = '&*' ;
25
- expectedReply . selectors = [ ] ;
23
+ assert . equal ( typeof reply . keys , 'string' ) ;
24
+ assert . equal ( typeof reply . channels , 'string' ) ;
25
+ assert . ok ( Array . isArray ( reply . selectors ) ) ;
26
26
} else {
27
- expectedReply . keys = [ '*' ] ;
28
- expectedReply . selectors = undefined ;
27
+ assert . ok ( Array . isArray ( reply . keys ) ) ;
29
28
30
- if ( testUtils . isVersionGreaterThan ( [ 6 , 2 ] ) ) {
31
- expectedReply . flags = [ 'on' , 'allkeys' , 'allchannels' , 'allcommands' , 'nopass' ] ;
32
- expectedReply . channels = [ '*' ] ;
33
- } else {
34
- expectedReply . flags = [ 'on' , 'allkeys' , 'allcommands' , 'nopass' ] ;
35
- expectedReply . channels = undefined ;
36
- }
29
+ if ( testUtils . isVersionGreaterThan ( [ 6 , 2 ] ) ) {
30
+ assert . ok ( Array . isArray ( reply . channels ) ) ;
31
+ }
37
32
}
38
-
39
- assert . deepEqual (
40
- await client . aclGetUser ( 'default' ) ,
41
- expectedReply
42
- ) ;
43
33
} , GLOBAL . SERVERS . OPEN ) ;
44
34
} ) ;
0 commit comments