You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
TCEs for select command pages (#2824)
* TCEs for select command pages * Preemptive modifications from previous reviews * Update to previous commit
This commit is contained in:
27
doctests/cmds-string.js
Normal file
27
doctests/cmds-string.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// EXAMPLE: cmds_string
|
||||
// REMOVE_START
|
||||
import assert from "node:assert";
|
||||
// REMOVE_END
|
||||
|
||||
// HIDE_START
|
||||
import { createClient } from 'redis';
|
||||
|
||||
const client = createClient();
|
||||
client.on('error', err => console.log('Redis Client Error', err));
|
||||
await client.connect().catch(console.error);
|
||||
// HIDE_END
|
||||
|
||||
// STEP_START incr
|
||||
await client.set("mykey", "10");
|
||||
const value1 = await client.incr("mykey");
|
||||
console.log(value1);
|
||||
// returns 11
|
||||
// REMOVE_START
|
||||
assert.equal(value1, 11);
|
||||
await client.del('mykey');
|
||||
// REMOVE_END
|
||||
// STEP_END
|
||||
|
||||
// HIDE_START
|
||||
await client.quit();
|
||||
// HIDE_END
|
Reference in New Issue
Block a user