From ca90d51fb8ddf7efc2b54b06489640bfe2f16e9f Mon Sep 17 00:00:00 2001 From: dovi Date: Tue, 2 May 2023 19:52:28 -0400 Subject: [PATCH] fix DEL spec --- packages/client/lib/commands/DEL.spec.ts | 45 +++++++++++++----------- packages/client/lib/commands/index.ts | 3 ++ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/packages/client/lib/commands/DEL.spec.ts b/packages/client/lib/commands/DEL.spec.ts index 75a29a8f64..6ec8ed8021 100644 --- a/packages/client/lib/commands/DEL.spec.ts +++ b/packages/client/lib/commands/DEL.spec.ts @@ -1,28 +1,31 @@ import { strict as assert } from 'assert'; import testUtils, { GLOBAL } from '../test-utils'; -import { transformArguments } from './DEL'; +import DEL from './DEL'; describe('DEL', () => { - describe('transformArguments', () => { - it('string', () => { - assert.deepEqual( - transformArguments('key'), - ['DEL', 'key'] - ); - }); - - it('array', () => { - assert.deepEqual( - transformArguments(['key1', 'key2']), - ['DEL', 'key1', 'key2'] - ); - }); + describe('transformArguments', () => { + it('string', () => { + assert.deepEqual( + DEL.transformArguments('key'), + ['DEL', 'key'] + ); }); - testUtils.testWithClient('client.del', async client => { - assert.equal( - await client.del('key'), - 0 - ); - }, GLOBAL.SERVERS.OPEN); + it('array', () => { + assert.deepEqual( + DEL.transformArguments(['key1', 'key2']), + ['DEL', 'key1', 'key2'] + ); + }); + }); + + testUtils.testAll('del', async client => { + assert.equal( + await client.del('key'), + 0 + ); + }, { + 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 2fad74caef..360308d3cd 100644 --- a/packages/client/lib/commands/index.ts +++ b/packages/client/lib/commands/index.ts @@ -42,6 +42,7 @@ import CLUSTER_MYID from './CLUSTER_MYID'; import CLUSTER_REPLICATE from './CLUSTER_REPLICATE'; import DECR from './DECR'; import DECRBY from './DECRBY'; +import DEL from './DEL'; import DUMP from './DUMP'; import GET from './GET'; import GETDEL from './GETDEL'; @@ -270,6 +271,8 @@ export default { decr: DECR, DECRBY, decrBy: DECRBY, + DEL, + del: DEL, DUMP, dump: DUMP, GET,