1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00
Files
node-redis/packages/client/lib/commands/SETEX.spec.ts

27 lines
740 B
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './SETEX';
describe('SETEX', () => {
it('transformArguments', () => {
assert.deepEqual(
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);
});