1
0
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:
David Dougherty
2024-09-26 04:27:12 -07:00
committed by GitHub
parent ebd2037e48
commit fd7b10be6c
4 changed files with 408 additions and 0 deletions

27
doctests/cmds-string.js Normal file
View 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