File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
- // EXAMPLE: set_and_get
1
+ // EXAMPLE: cmds_string
2
2
// REMOVE_START
3
3
import assert from "assert" ;
4
4
// REMOVE_END
@@ -7,19 +7,21 @@ import assert from "assert";
7
7
import { createClient } from 'redis' ;
8
8
9
9
const client = createClient ( ) ;
10
-
11
10
client . on ( 'error' , err => console . log ( 'Redis Client Error' , err ) ) ;
12
-
13
11
await client . connect ( ) ;
14
-
12
+ await client . del ( 'bike:1' )
15
13
// HIDE_END
14
+
15
+ // STEP_START set_and_get
16
16
await client . set ( 'bike:1' , 'Process 134' ) ;
17
17
const value = await client . get ( 'bike:1' ) ;
18
18
console . log ( value ) ;
19
19
// returns 'Process 134'
20
- //REMOVE_START
20
+ // REMOVE_START
21
21
assert . equal ( value , 'Process 134' ) ;
22
- //REMOVE_END
22
+ await client . del ( 'bike:1' )
23
+ // REMOVE_END
24
+ // STEP_END
23
25
24
26
// HIDE_START
25
27
await client . quit ( ) ;
You can’t perform that action at this time.
0 commit comments