You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
32 lines
723 B
TypeScript
32 lines
723 B
TypeScript
import { strict as assert } from 'node:assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import PEXPIRE from './PEXPIRE';
|
|
|
|
describe('PEXPIRE', () => {
|
|
describe('transformArguments', () => {
|
|
it('simple', () => {
|
|
assert.deepEqual(
|
|
PEXPIRE.transformArguments('key', 1),
|
|
['PEXPIRE', 'key', '1']
|
|
);
|
|
});
|
|
|
|
it('with set option', () => {
|
|
assert.deepEqual(
|
|
PEXPIRE.transformArguments('key', 1, 'GT'),
|
|
['PEXPIRE', 'key', '1', 'GT']
|
|
);
|
|
});
|
|
});
|
|
|
|
testUtils.testAll('pExpire', async client => {
|
|
assert.equal(
|
|
await client.pExpire('key', 1),
|
|
0
|
|
);
|
|
}, {
|
|
client: GLOBAL.SERVERS.OPEN,
|
|
cluster: GLOBAL.CLUSTERS.OPEN
|
|
});
|
|
});
|