From 3ab624165607da9e18f8486a540295055965e6c3 Mon Sep 17 00:00:00 2001 From: dovi Date: Wed, 3 May 2023 14:18:15 -0400 Subject: [PATCH] fix OBJECT_IDLETIME spec --- .../lib/commands/OBJECT_IDLETIME.spec.ts | 29 ++++++++++--------- packages/client/lib/commands/index.ts | 3 ++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/client/lib/commands/OBJECT_IDLETIME.spec.ts b/packages/client/lib/commands/OBJECT_IDLETIME.spec.ts index 61529e1366..ed908d142f 100644 --- a/packages/client/lib/commands/OBJECT_IDLETIME.spec.ts +++ b/packages/client/lib/commands/OBJECT_IDLETIME.spec.ts @@ -1,19 +1,22 @@ import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; -import { transformArguments } from './OBJECT_IDLETIME'; +import OBJECT_IDLETIME from './OBJECT_IDLETIME'; describe('OBJECT IDLETIME', () => { - it('transformArguments', () => { - assert.deepEqual( - transformArguments('key'), - ['OBJECT', 'IDLETIME', 'key'] - ); - }); + it('transformArguments', () => { + assert.deepEqual( + OBJECT_IDLETIME.transformArguments('key'), + ['OBJECT', 'IDLETIME', 'key'] + ); + }); - testUtils.testWithClient('client.objectIdleTime', async client => { - assert.equal( - await client.objectIdleTime('key'), - null - ); - }, GLOBAL.SERVERS.OPEN); + testUtils.testAll('client.objectIdleTime', async client => { + assert.equal( + await client.objectIdleTime('key'), + null + ); + }, { + client: GLOBAL.SERVERS.OPEN, + cluster: GLOBAL.CLUSTERS.OPEN + }); }); diff --git a/packages/client/lib/commands/index.ts b/packages/client/lib/commands/index.ts index a2a6f73764..ed6a42ec8e 100644 --- a/packages/client/lib/commands/index.ts +++ b/packages/client/lib/commands/index.ts @@ -98,6 +98,7 @@ import MSET from './MSET'; import MSETNX from './MSETNX'; import OBJECT_ENCODING from './OBJECT_ENCODING'; import OBJECT_FREQ from './OBJECT_FREQ'; +import OBJECT_IDLETIME from './OBJECT_IDLETIME'; import PERSIST from './PERSIST'; import EXISTS from './EXISTS'; import EXPIRE from './EXPIRE'; @@ -389,6 +390,8 @@ export default { objectEncoding: OBJECT_ENCODING, OBJECT_FREQ, objectFreq: OBJECT_FREQ, + OBJECT_IDLETIME, + objectIdleTime: OBJECT_IDLETIME, PERSIST, persist: PERSIST, EXISTS,