NodeRedis/node-redis

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

Summary

Maintainability
B
4 hrs
Test Coverage
import { strict as assert } from 'node:assert';
import testUtils, { GLOBAL } from '../test-utils';
import HEXISTS from './HEXISTS';
import { parseArgs } from './generic-transformers';

describe('HEXISTS', () => {
  it('processCommand', () => {
    assert.deepEqual(
      parseArgs(HEXISTS, 'key', 'field'),
      ['HEXISTS', 'key', 'field']
    );
  });

  testUtils.testAll('hExists', async client => {
    assert.equal(
      await client.hExists('key', 'field'),
      0
    );
  }, {
    client: GLOBAL.SERVERS.OPEN,
    cluster: GLOBAL.CLUSTERS.OPEN
  });
});