1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

some more commands

This commit is contained in:
Leibale
2023-04-30 10:08:25 -04:00
parent 2c4dc95a44
commit 53b9397a78
8 changed files with 259 additions and 243 deletions

View File

@@ -1,26 +1,22 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './SETEX';
import SETEX from './SETEX';
describe('SETEX', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments('key', 1, 'value'),
['SETEX', 'key', '1', 'value']
);
});
it('transformArguments', () => {
assert.deepEqual(
SETEX.transformArguments('key', 1, 'value'),
['SETEX', 'key', '1', 'value']
);
});
testUtils.testWithClient('client.setEx', async client => {
assert.equal(
await client.setEx('key', 1, 'value'),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithCluster('cluster.setEx', async cluster => {
assert.equal(
await cluster.setEx('key', 1, 'value'),
'OK'
);
}, GLOBAL.CLUSTERS.OPEN);
testUtils.testAll('setEx', async client => {
assert.equal(
await client.setEx('key', 1, 'value'),
'OK'
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
});