NodeRedis/node-redis

View on GitHub
packages/client/lib/commands/CLUSTER_ADDSLOTS.spec.ts

Summary

Maintainability
A
3 hrs
Test Coverage
import { strict as assert } from 'node:assert';
import CLUSTER_ADDSLOTS from './CLUSTER_ADDSLOTS';
import { parseArgs } from './generic-transformers';

describe('CLUSTER ADDSLOTS', () => {
  describe('transformArguments', () => {
    it('single', () => {
      assert.deepEqual(
        parseArgs(CLUSTER_ADDSLOTS, 0),
        ['CLUSTER', 'ADDSLOTS', '0']
      );
    });

    it('multiple', () => {
      assert.deepEqual(
        parseArgs(CLUSTER_ADDSLOTS, [0, 1]),
        ['CLUSTER', 'ADDSLOTS', '0', '1']
      );
    });
  });
});