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

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)
This commit is contained in:
Leibale Eidelman
2021-03-08 14:12:26 -05:00
committed by GitHub
parent 218874432e
commit fbca5cda0a
22 changed files with 129 additions and 98 deletions

View File

@@ -43,7 +43,7 @@ describe('detect_buffers', function () {
describe('first argument is a buffer', function () {
it('returns a buffer', function (done) {
client.get(new Buffer('string key 1'), function (err, reply) {
client.get(Buffer.from('string key 1'), function (err, reply) {
assert.strictEqual(true, Buffer.isBuffer(reply));
assert.strictEqual('<Buffer 73 74 72 69 6e 67 20 76 61 6c 75 65>', reply.inspect());
return done(err);
@@ -51,7 +51,7 @@ describe('detect_buffers', function () {
});
it('returns a bufffer when executed as part of transaction', function (done) {
client.multi().get(new Buffer('string key 1')).exec(function (err, reply) {
client.multi().get(Buffer.from('string key 1')).exec(function (err, reply) {
assert.strictEqual(1, reply.length);
assert.strictEqual(true, Buffer.isBuffer(reply[0]));
assert.strictEqual('<Buffer 73 74 72 69 6e 67 20 76 61 6c 75 65>', reply[0].inspect());
@@ -65,8 +65,8 @@ describe('detect_buffers', function () {
it('can interleave string and buffer results', function (done) {
client.multi()
.hget('hash key 2', 'key 1')
.hget(new Buffer('hash key 2'), 'key 1')
.hget('hash key 2', new Buffer('key 2'))
.hget(Buffer.from('hash key 2'), 'key 1')
.hget('hash key 2', Buffer.from('key 2'))
.hget('hash key 2', 'key 2')
.exec(function (err, reply) {
assert.strictEqual(true, Array.isArray(reply));
@@ -86,8 +86,8 @@ describe('detect_buffers', function () {
it('can interleave string and buffer results', function (done) {
client.batch()
.hget('hash key 2', 'key 1')
.hget(new Buffer('hash key 2'), 'key 1')
.hget('hash key 2', new Buffer('key 2'))
.hget(Buffer.from('hash key 2'), 'key 1')
.hget('hash key 2', Buffer.from('key 2'))
.hget('hash key 2', 'key 2')
.exec(function (err, reply) {
assert.strictEqual(true, Array.isArray(reply));
@@ -150,7 +150,7 @@ describe('detect_buffers', function () {
describe('first argument is a buffer', function () {
it('returns buffers for keys requested', function (done) {
client.hmget(new Buffer('hash key 2'), 'key 1', 'key 2', function (err, reply) {
client.hmget(Buffer.from('hash key 2'), 'key 1', 'key 2', function (err, reply) {
assert.strictEqual(true, Array.isArray(reply));
assert.strictEqual(2, reply.length);
assert.strictEqual(true, Buffer.isBuffer(reply[0]));
@@ -162,7 +162,7 @@ describe('detect_buffers', function () {
});
it('returns buffers for keys requested in transaction', function (done) {
client.multi().hmget(new Buffer('hash key 2'), 'key 1', 'key 2').exec(function (err, reply) {
client.multi().hmget(Buffer.from('hash key 2'), 'key 1', 'key 2').exec(function (err, reply) {
assert.strictEqual(true, Array.isArray(reply));
assert.strictEqual(1, reply.length);
assert.strictEqual(2, reply[0].length);
@@ -175,7 +175,7 @@ describe('detect_buffers', function () {
});
it('returns buffers for keys requested in .batch', function (done) {
client.batch().hmget(new Buffer('hash key 2'), 'key 1', 'key 2').exec(function (err, reply) {
client.batch().hmget(Buffer.from('hash key 2'), 'key 1', 'key 2').exec(function (err, reply) {
assert.strictEqual(true, Array.isArray(reply));
assert.strictEqual(1, reply.length);
assert.strictEqual(2, reply[0].length);
@@ -226,7 +226,7 @@ describe('detect_buffers', function () {
describe('first argument is a buffer', function () {
it('returns buffer values', function (done) {
client.hgetall(new Buffer('hash key 2'), function (err, reply) {
client.hgetall(Buffer.from('hash key 2'), function (err, reply) {
assert.strictEqual(null, err);
assert.strictEqual('object', typeof reply);
assert.strictEqual(2, Object.keys(reply).length);
@@ -239,7 +239,7 @@ describe('detect_buffers', function () {
});
it('returns buffer values when executed in transaction', function (done) {
client.multi().hgetall(new Buffer('hash key 2')).exec(function (err, reply) {
client.multi().hgetall(Buffer.from('hash key 2')).exec(function (err, reply) {
assert.strictEqual(1, reply.length);
assert.strictEqual('object', typeof reply[0]);
assert.strictEqual(2, Object.keys(reply[0]).length);
@@ -252,7 +252,7 @@ describe('detect_buffers', function () {
});
it('returns buffer values when executed in .batch', function (done) {
client.batch().hgetall(new Buffer('hash key 2')).exec(function (err, reply) {
client.batch().hgetall(Buffer.from('hash key 2')).exec(function (err, reply) {
assert.strictEqual(1, reply.length);
assert.strictEqual('object', typeof reply[0]);
assert.strictEqual(2, Object.keys(reply[0]).length);