1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

some more commands

This commit is contained in:
Leibale
2023-05-01 06:58:27 -04:00
parent a5d0963fcf
commit 4304f4dba3
22 changed files with 354 additions and 328 deletions

View File

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