1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00
Files
node-redis/test/commands/hlen.spec.js
Leibale Eidelman fbca5cda0a Upgrade node and dependencies (#1578)
* upgrade workflow actions

* fix setup-node version

* change redis-64 version to 3.0.503

* fix "no password is set" for redis6,
fix tests to work with redis6,
add redis6 to workflows

* do not use assert.match (was added only at v13.6.0 & v12.16.0)

* fix errors.subscribeUnsubscribeOnly regex

* fix invaliodPassword typo

* send --save "" to redis-server in tests

* upgrade dependencies, set node minimum version to 10, use current LTS versions in tests and benchmark workflows

* change windows tests too

* revert mocha back to ^4.1.0

* fix for f5528504a0 - revert mocha back to ^4.1.0

* fix some tests and upgrade mocha

* fix two more tests

* try to fix tests in windows

* upgrade denque and redis-commands
ref #1575

* replace `new Buffer` (deprecated) with `Buffer.from`

* Buffer.from(0) should be Buffer.alloc(0)
2021-03-08 14:12:26 -05:00

39 lines
1.1 KiB
JavaScript

'use strict';
var config = require('../lib/config');
var helper = require('../helper');
var redis = config.redis;
describe("The 'hlen' method", function () {
helper.allTests(function (ip, args) {
describe('using ' + ip, function () {
var client;
beforeEach(function (done) {
client = redis.createClient.apply(null, args);
client.once('ready', function () {
client.flushdb(done);
});
});
it('reports the count of keys', function (done) {
var hash = 'test hash';
var field1 = Buffer.from('0123456789');
var value1 = Buffer.from('abcdefghij');
var field2 = Buffer.alloc(0);
var value2 = Buffer.alloc(0);
client.HSET(hash, field1, value1, helper.isNumber(1));
client.HSET(hash, field2, value2, helper.isNumber(1));
client.HLEN(hash, helper.isNumber(2, done));
});
afterEach(function () {
client.end(true);
});
});
});
});