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

fix EXPIRETIME spec

This commit is contained in:
dovi
2023-05-02 20:17:15 -04:00
parent fe1ae49a40
commit 2ea068ac77
2 changed files with 20 additions and 14 deletions

View File

@@ -1,21 +1,24 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './EXPIRETIME';
import EXPIRETIME from './EXPIRETIME';
describe('EXPIRETIME', () => {
testUtils.isVersionGreaterThanHook([7]);
testUtils.isVersionGreaterThanHook([7]);
it('transformArguments', () => {
assert.deepEqual(
transformArguments('key'),
['EXPIRETIME', 'key']
);
});
it('transformArguments', () => {
assert.deepEqual(
EXPIRETIME.transformArguments('key'),
['EXPIRETIME', 'key']
);
});
testUtils.testWithClient('client.expireTime', async client => {
assert.equal(
await client.expireTime('key'),
-2
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testAll('expireTime', async client => {
assert.equal(
await client.expireTime('key'),
-2
);
}, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
});