File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
packages/client/lib/commands Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,23 @@ describe('LINDEX', () => {
10
10
) ;
11
11
} ) ;
12
12
13
- testUtils . testWithClient ( 'client.lIndex' , async client => {
14
- assert . equal (
15
- await client . lIndex ( 'key' , 0 ) ,
16
- null
17
- ) ;
18
- } , GLOBAL . SERVERS . OPEN ) ;
13
+ describe ( 'client.lIndex' , ( ) => {
14
+ testUtils . testWithClient ( 'null' , async client => {
15
+ assert . equal (
16
+ await client . lIndex ( 'key' , 0 ) ,
17
+ null
18
+ ) ;
19
+ } , GLOBAL . SERVERS . OPEN ) ;
20
+
21
+ testUtils . testWithClient ( 'with value' , async client => {
22
+ const [ , lIndexReply ] = await Promise . all ( [
23
+ client . lPush ( 'key' , 'element' ) ,
24
+ client . lIndex ( 'key' , 0 )
25
+ ] ) ;
26
+
27
+ assert . equal ( lIndexReply , 'element' ) ;
28
+ } , GLOBAL . SERVERS . OPEN ) ;
29
+ } ) ;
19
30
20
31
testUtils . testWithCluster ( 'cluster.lIndex' , async cluster => {
21
32
assert . equal (
You can’t perform that action at this time.
0 commit comments