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

fix BITCOUNT spec

This commit is contained in:
dovi
2023-05-03 18:59:43 -04:00
parent 4de409e0ad
commit f6be2c77d8

View File

@@ -1,12 +1,12 @@
import { strict as assert } from 'assert'; import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils'; import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './BITCOUNT'; import BITCOUNT from './BITCOUNT';
describe('BITCOUNT', () => { describe('BITCOUNT', () => {
describe('transformArguments', () => { describe('transformArguments', () => {
it('simple', () => { it('simple', () => {
assert.deepEqual( assert.deepEqual(
transformArguments('key'), BITCOUNT.transformArguments('key'),
['BITCOUNT', 'key'] ['BITCOUNT', 'key']
); );
}); });
@@ -14,7 +14,7 @@ describe('BITCOUNT', () => {
describe('with range', () => { describe('with range', () => {
it('simple', () => { it('simple', () => {
assert.deepEqual( assert.deepEqual(
transformArguments('key', { BITCOUNT.transformArguments('key', {
start: 0, start: 0,
end: 1 end: 1
}), }),
@@ -24,7 +24,7 @@ describe('BITCOUNT', () => {
it('with mode', () => { it('with mode', () => {
assert.deepEqual( assert.deepEqual(
transformArguments('key', { BITCOUNT.transformArguments('key', {
start: 0, start: 0,
end: 1, end: 1,
mode: 'BIT' mode: 'BIT'
@@ -35,10 +35,13 @@ describe('BITCOUNT', () => {
}); });
}); });
testUtils.testWithClient('client.bitCount', async client => { testUtils.testAll('bitCount', async client => {
assert.equal( assert.equal(
await client.bitCount('key'), await client.bitCount('key'),
0 0
); );
}, GLOBAL.SERVERS.OPEN); }, {
client: GLOBAL.SERVERS.OPEN,
cluster: GLOBAL.CLUSTERS.OPEN
});
}); });