1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-15 23:55:38 +03:00

feat(client): add CAS/CAD, DELEX, DIGEST support (#3123)

* feat: add digest command and tests

* feat: add delex command and tests

* feat: add more conditional options to SET update tests
This commit is contained in:
Pavel Pashov
2025-11-03 13:53:01 +02:00
committed by GitHub
parent 5a0a06df69
commit 2fdb6def45
7 changed files with 244 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import { strict as assert } from 'node:assert';
import testUtils, { GLOBAL } from '../test-utils';
import SET from './SET';
@@ -127,6 +128,16 @@ describe('SET', () => {
['SET', 'key', 'value', 'XX']
);
});
it('with IFDEQ condition', () => {
assert.deepEqual(
parseArgs(SET, 'key', 'value', {
condition: 'IFDEQ',
matchValue: 'some-value'
}),
['SET', 'key', 'value', 'IFDEQ', 'some-value']
);
});
});
it('with GET', () => {
@@ -162,4 +173,19 @@ describe('SET', () => {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
testUtils.testAll('set with IFEQ', async client => {
await client.set('key{tag}', 'some-value');
assert.equal(
await client.set('key{tag}', 'some-value', {
condition: 'IFEQ',
matchValue: 'some-value'
}),
'OK'
);
}, {
client: { ...GLOBAL.SERVERS.OPEN, minimumDockerVersion: [8, 4] },
cluster: { ...GLOBAL.CLUSTERS.OPEN, minimumDockerVersion: [8, 4] },
});
});