From c78e55d874dc1a791ee75d02b30196a01d9202a4 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:25:28 +0000 Subject: [PATCH 01/18] tests: use stream timeout property instead of internal property fixes broken test --- test/connection.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/connection.spec.js b/test/connection.spec.js index c33d1b8a83..f467f19578 100644 --- a/test/connection.spec.js +++ b/test/connection.spec.js @@ -401,10 +401,10 @@ describe('connection tests', function () { connect_timeout: 1000 }); process.nextTick(function () { - assert.strictEqual(client.stream._idleTimeout, 1000); + assert.strictEqual(client.stream.timeout, 1000); }); client.on('connect', function () { - assert.strictEqual(client.stream._idleTimeout, -1); + assert.strictEqual(client.stream.timeout, 0); assert.strictEqual(client.stream.listeners('timeout').length, 0); client.on('ready', done); }); From fbdac9e0ad338e730445116daabdde1893f9f7ba Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:26:53 +0000 Subject: [PATCH 02/18] tests: remove hiredis from testing suite as parser no longer supports hiredis --- test/helper.js | 5 ----- test/pubsub.spec.js | 8 ++------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/test/helper.js b/test/helper.js index e851b7f7b3..29a07d6f31 100644 --- a/test/helper.js +++ b/test/helper.js @@ -163,11 +163,6 @@ module.exports = { } var parsers = ['javascript']; var protocols = ['IPv4']; - // The js parser works the same as the hiredis parser, just activate this if you want to be on the safe side - // try { - // require('hiredis'); - // parsers.push('hiredis'); - // } catch (e) {/* ignore eslint */} if (process.platform !== 'win32') { protocols.push('IPv6', '/tmp/redis.sock'); } diff --git a/test/pubsub.spec.js b/test/pubsub.spec.js index 94b0fc1880..c017cdb36f 100644 --- a/test/pubsub.spec.js +++ b/test/pubsub.spec.js @@ -515,8 +515,8 @@ describe('publish/subscribe', function () { sub.stream.once('data', function () { assert.strictEqual(sub.message_buffers, false); assert.strictEqual(sub.shouldBuffer, false); - sub.on('pmessageBuffer', function (pattern, channel, message) { - if (parser !== 'javascript' && typeof pattern === 'string') { + sub.on('pmessageBuffer', function (pattern, channel) { + if (typeof pattern === 'string') { pattern = new Buffer(pattern); channel = new Buffer(channel); } @@ -524,10 +524,6 @@ describe('publish/subscribe', function () { assert.strictEqual(channel.inspect(), new Buffer('/foo').inspect()); sub.quit(end); }); - if (parser === 'javascript') { - assert.notStrictEqual(sub.message_buffers, sub.buffers); - } - }); var batch = sub.batch(); batch.psubscribe('*'); From 7c551bf4741b97bf5d67271b5a20bc2829cbfb76 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:27:49 +0000 Subject: [PATCH 03/18] tests: fix tls tests and enable stunnel tests for travis --- test/tls.spec.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/tls.spec.js b/test/tls.spec.js index e3c758285b..127a2cfb8d 100644 --- a/test/tls.spec.js +++ b/test/tls.spec.js @@ -19,9 +19,6 @@ var tls_port = 6380; // Use skip instead of returning to indicate what tests really got skipped var skip = false; -// Wait until stunnel4 is in the travis whitelist -// Check: https://github.com/travis-ci/apt-package-whitelist/issues/403 -// If this is merged, remove the travis env checks describe('TLS connection tests', function () { before(function (done) { @@ -29,9 +26,6 @@ describe('TLS connection tests', function () { if (process.platform === 'win32') { skip = true; console.warn('\nStunnel tests do not work on windows atm. If you think you can fix that, it would be warmly welcome.\n'); - } else if (process.env.TRAVIS === 'true') { - skip = true; - console.warn('\nTravis does not support stunnel right now. Skipping tests.\nCheck: https://github.com/travis-ci/apt-package-whitelist/issues/403\n'); } if (skip) return done(); helper.stopStunnel(function () { @@ -58,7 +52,7 @@ describe('TLS connection tests', function () { client = redis.createClient({ connect_timeout: connect_timeout, port: tls_port, - tls: tls_options + tls: utils.clone(tls_options) }); var time = 0; assert.strictEqual(client.address, '127.0.0.1:' + tls_port); @@ -109,12 +103,14 @@ describe('TLS connection tests', function () { client.get('foo', helper.isString('bar', done)); }); - describe('using rediss as url protocol', function (done) { + describe('using rediss as url protocol', function () { var tls_connect = tls.connect; beforeEach(function () { tls.connect = function (options) { options = utils.clone(options); options.ca = tls_options.ca; + options.servername = 'redis.js.org'; + options.rejectUnauthorized = true; return tls_connect.call(tls, options); }; }); From a4fec3c361f513f57bdd5b7ce0fa0a96c03c9260 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:29:02 +0000 Subject: [PATCH 04/18] tests(travis): drop < node v4, add v13 & install stunnel --- .travis.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 09398ddac0..0248be673f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,18 @@ addons: packages: - g++-4.8 node_js: - - "0.10" - - "0.12" - "4" - "6" - "8" - "12" + - "13" + +before_install: + - if [[ ! -f downloads/stunnel-5.54.tar.gz ]]; then wget -O downloads/stunnel-5.54.tar.gz ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-5.54.tar.gz; fi + - if [[ ! -f ./stunnel-5.54/configure ]]; then tar -xzf downloads/stunnel-5.54.tar.gz; fi + - if [[ ! -f ./stunnel-5.54/src/stunnel ]]; then cd ./stunnel-5.54; ./configure; make; cd ..; fi + - export PATH="$PATH:$(pwd)/stunnel-5.54/src" + after_success: npm run coveralls before_script: # Add an IPv6 config - see the corresponding Travis issue From 17c12339887c4dce5b96e073e48105c4f83076bd Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:30:15 +0000 Subject: [PATCH 05/18] tests(appveyor): drop < node v4 & add v13 --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e3d2c2a940..42155ac1d2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,12 +3,11 @@ # Test against these versions of Node.js. environment: matrix: - - nodejs_version: "0.10" - - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "6" - nodejs_version: "8" - nodejs_version: "12" + - nodejs_version: "13" pull_requests: do_not_increment_build_number: true From 694154b377f1ad8e2bcbd67d846301e0275627e6 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:33:03 +0000 Subject: [PATCH 06/18] chore: add IDE files to .gitignore --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index 2290a8ec51..43529fa00b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,14 @@ coverage stunnel.conf stunnel.pid *.out +package-lock.json + +# IntelliJ IDEs +.idea + +# VisualStudioCode IDEs +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json From 0adcb738014b969de9b7bdd4e977cab7693667ef Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 21:45:34 +0000 Subject: [PATCH 07/18] tests(travis): cache stunnel install --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0248be673f..e0c8e7d152 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,15 @@ node_js: - "13" before_install: - - if [[ ! -f downloads/stunnel-5.54.tar.gz ]]; then wget -O downloads/stunnel-5.54.tar.gz ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-5.54.tar.gz; fi - - if [[ ! -f ./stunnel-5.54/configure ]]; then tar -xzf downloads/stunnel-5.54.tar.gz; fi + - if [[ ! -f stunnel.tar.gz ]]; then wget -O stunnel.tar.gz ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-5.54.tar.gz; fi + - if [[ ! -f ./stunnel-5.54/configure ]]; then tar -xzf stunnel.tar.gz; fi - if [[ ! -f ./stunnel-5.54/src/stunnel ]]; then cd ./stunnel-5.54; ./configure; make; cd ..; fi - export PATH="$PATH:$(pwd)/stunnel-5.54/src" +cache: + directories: + - '$TRAVIS_BUILD_DIR/stunnel-5.54' + after_success: npm run coveralls before_script: # Add an IPv6 config - see the corresponding Travis issue From 5be0d3a78e93daa6cdd227a6d079c534cc162a47 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 22:00:11 +0000 Subject: [PATCH 08/18] chore: update .gitignore --- .gitignore | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 43529fa00b..037016a27f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,10 +11,6 @@ package-lock.json # IntelliJ IDEs .idea - # VisualStudioCode IDEs -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +.vscode +.vs From 031e00f22e8672e152d8f2bc58968a940840bbf9 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 22:13:22 +0000 Subject: [PATCH 09/18] tests: fix socket timeout test Node <= 4 --- test/connection.spec.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/connection.spec.js b/test/connection.spec.js index f467f19578..f6dc8310cb 100644 --- a/test/connection.spec.js +++ b/test/connection.spec.js @@ -401,10 +401,22 @@ describe('connection tests', function () { connect_timeout: 1000 }); process.nextTick(function () { - assert.strictEqual(client.stream.timeout, 1000); + // node > 4 + var timeout = client.stream.timeout; + // node <= 4 + if (timeout === undefined) timeout = client.stream._idleTimeout; + assert.strictEqual(timeout, 1000); }); client.on('connect', function () { - assert.strictEqual(client.stream.timeout, 0); + // node > 4 + var expected = 0; + var timeout = client.stream.timeout; + // node <= 4 + if (timeout === undefined) { + timeout = client.stream._idleTimeout; + expected = -1; + } + assert.strictEqual(timeout, expected); assert.strictEqual(client.stream.listeners('timeout').length, 0); client.on('ready', done); }); From 36b62fe5792ee4f33a58ad7f8916e708e0bd0b1d Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 22:26:55 +0000 Subject: [PATCH 10/18] tests: fix error codes test Node >= 13 --- test/node_redis.spec.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 82b3e4e09f..a6504ddf2b 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -986,7 +986,14 @@ describe('The node_redis client', function () { } } else { assert.equal(err.code, 'ECONNREFUSED'); - assert.equal(err.errno, 'ECONNREFUSED'); + + if (typeof err.errno === 'number') { + // >= Node 13 + assert.equal(err.errno, -61); + } else { + // < Node 13 + assert.equal(err.errno, 'ECONNREFUSED'); + } assert.equal(err.syscall, 'connect'); } }); From 13ec6afe5802cfd426cc411b74d4ac0a22b3e3e1 Mon Sep 17 00:00:00 2001 From: Salakar Date: Thu, 6 Feb 2020 23:59:31 +0000 Subject: [PATCH 11/18] tests: fix Error & Domain tests on Node >= 13 --- test/node_redis.spec.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index a6504ddf2b..d23cd7b81c 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -675,15 +675,21 @@ describe('The node_redis client', function () { done(); }); }); - require('domain').create(); }); it('catches all errors from within the domain', function (done) { var domain = require('domain').create(); domain.run(function () { - // Trigger an error within the domain + if (process.versions.node.split('.')[0] >= 13) { + // Node >= 13 + // Recreate client in domain so error handlers run this domain + // Changed in: "error handler runs outside of its domain" + // https://github.com/nodejs/node/pull/26211 + client = redis.createClient(); + } client.end(true); + // Trigger an error within the domain client.set('domain', 'value'); }); @@ -1053,7 +1059,13 @@ describe('The node_redis client', function () { end(); } else { assert.equal(err.code, 'ECONNREFUSED'); - assert.equal(err.errno, 'ECONNREFUSED'); + if (typeof err.errno === 'number') { + // >= Node 13 + assert.equal(err.errno, -61); + } else { + // < Node 13 + assert.equal(err.errno, 'ECONNREFUSED'); + } assert.equal(err.syscall, 'connect'); end(); } @@ -1139,7 +1151,13 @@ describe('The node_redis client', function () { end(); } else { assert.equal(err.code, 'ECONNREFUSED'); - assert.equal(err.errno, 'ECONNREFUSED'); + if (typeof err.errno === 'number') { + // >= Node 13 + assert.equal(err.errno, -61); + } else { + // < Node 13 + assert.equal(err.errno, 'ECONNREFUSED'); + } assert.equal(err.syscall, 'connect'); redis.debug_mode = false; client.end(true); From 9d65e1c3ededcf3f266ddab0a509a47432dc7ddc Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 00:31:08 +0000 Subject: [PATCH 12/18] tests: fix buffer test (failed due to new parser) & remove unused node feature checks (< 4) --- index.js | 12 ------------ lib/commands.js | 28 ++++++---------------------- test/pubsub.spec.js | 2 ++ 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/index.js b/index.js index 402b9b1e47..b1f265262c 100644 --- a/index.js +++ b/index.js @@ -20,11 +20,6 @@ var SUBSCRIBE_COMMANDS = { punsubscribe: true }; -// Newer Node.js versions > 0.10 return the EventEmitter right away and using .EventEmitter was deprecated -if (typeof EventEmitter !== 'function') { - EventEmitter = EventEmitter.EventEmitter; -} - function noop () {} function handle_detect_buffers_reply (reply, command, buffer_args) { @@ -153,7 +148,6 @@ function RedisClient (options, stream) { this.server_info = {}; this.auth_pass = options.auth_pass || options.password; this.selected_db = options.db; // Save the selected db here, used when reconnecting - this.old_state = null; this.fire_strings = true; // Determine if strings or buffers should be written to the stream this.pipeline = false; this.sub_commands_left = 0; @@ -175,12 +169,6 @@ function RedisClient (options, stream) { 'If you want to keep on listening to this event please listen to the stream drain event directly.' ); } else if ((event === 'message_buffer' || event === 'pmessage_buffer' || event === 'messageBuffer' || event === 'pmessageBuffer') && !this.buffers && !this.message_buffers) { - if (this.reply_parser.name !== 'javascript') { - return this.warn( - 'You attached the "' + event + '" listener without the returnBuffers option set to true.\n' + - 'Please use the JavaScript parser or set the returnBuffers option to true to return buffers.' - ); - } this.reply_parser.optionReturnBuffers = true; this.message_buffers = true; this.handle_reply = handle_detect_buffers_reply; diff --git a/lib/commands.js b/lib/commands.js index 6275ec8bf6..a3b5189698 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -4,18 +4,6 @@ var commands = require('redis-commands'); var Multi = require('./multi'); var RedisClient = require('../').RedisClient; var Command = require('./command'); -// Feature detect if a function may change it's name -var changeFunctionName = (function () { - var fn = function abc () {}; - try { - Object.defineProperty(fn, 'name', { - value: 'foobar' - }); - return true; - } catch (e) { - return false; - } -}()); var addCommand = function (command) { // Some rare Redis commands use special characters in their command name @@ -61,11 +49,9 @@ var addCommand = function (command) { if (commandName !== command) { RedisClient.prototype[commandName.toUpperCase()] = RedisClient.prototype[commandName] = RedisClient.prototype[command]; } - if (changeFunctionName) { - Object.defineProperty(RedisClient.prototype[command], 'name', { - value: commandName - }); - } + Object.defineProperty(RedisClient.prototype[command], 'name', { + value: commandName + }); } // Do not override existing functions @@ -108,11 +94,9 @@ var addCommand = function (command) { if (commandName !== command) { Multi.prototype[commandName.toUpperCase()] = Multi.prototype[commandName] = Multi.prototype[command]; } - if (changeFunctionName) { - Object.defineProperty(Multi.prototype[command], 'name', { - value: commandName - }); - } + Object.defineProperty(Multi.prototype[command], 'name', { + value: commandName + }); } }; diff --git a/test/pubsub.spec.js b/test/pubsub.spec.js index c017cdb36f..da2561459f 100644 --- a/test/pubsub.spec.js +++ b/test/pubsub.spec.js @@ -524,6 +524,8 @@ describe('publish/subscribe', function () { assert.strictEqual(channel.inspect(), new Buffer('/foo').inspect()); sub.quit(end); }); + // Either message_buffers or buffers has to be true, but not both at the same time + assert.notStrictEqual(sub.message_buffers, sub.buffers); }); var batch = sub.batch(); batch.psubscribe('*'); From 9e3b57eae7f8a1d0668ee7645e8180f79fc6e349 Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 00:54:52 +0000 Subject: [PATCH 13/18] tests: use util.getSystemErrorName for errno --- index.js | 1 - test/node_redis.spec.js | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index b1f265262c..b5acf785eb 100644 --- a/index.js +++ b/index.js @@ -204,7 +204,6 @@ function create_parser (self) { self.create_stream(); }, returnBuffers: self.buffers || self.message_buffers, - name: self.options.parser || 'javascript', stringNumbers: self.options.string_numbers || false }); } diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index d23cd7b81c..22bd74463c 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -2,6 +2,7 @@ var assert = require('assert'); var fs = require('fs'); +var util = require('util'); var path = require('path'); var intercept = require('intercept-stdout'); var config = require('./lib/config'); @@ -995,7 +996,7 @@ describe('The node_redis client', function () { if (typeof err.errno === 'number') { // >= Node 13 - assert.equal(err.errno, -61); + assert.equal(err.errno, util.getSystemErrorName(err.errno)); } else { // < Node 13 assert.equal(err.errno, 'ECONNREFUSED'); @@ -1061,7 +1062,7 @@ describe('The node_redis client', function () { assert.equal(err.code, 'ECONNREFUSED'); if (typeof err.errno === 'number') { // >= Node 13 - assert.equal(err.errno, -61); + assert.equal(err.errno, util.getSystemErrorName(err.errno)); } else { // < Node 13 assert.equal(err.errno, 'ECONNREFUSED'); @@ -1153,7 +1154,7 @@ describe('The node_redis client', function () { assert.equal(err.code, 'ECONNREFUSED'); if (typeof err.errno === 'number') { // >= Node 13 - assert.equal(err.errno, -61); + assert.equal(err.errno, util.getSystemErrorName(err.errno)); } else { // < Node 13 assert.equal(err.errno, 'ECONNREFUSED'); From 9220016c7d70b0bfebd4bbeb890396f5fe4b2b0a Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 01:06:47 +0000 Subject: [PATCH 14/18] tests: use util.getSystemErrorName for errno --- test/node_redis.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 22bd74463c..317723f56a 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -996,7 +996,7 @@ describe('The node_redis client', function () { if (typeof err.errno === 'number') { // >= Node 13 - assert.equal(err.errno, util.getSystemErrorName(err.errno)); + assert.equal(util.getSystemErrorName(err.errno), 'ECONNREFUSED'); } else { // < Node 13 assert.equal(err.errno, 'ECONNREFUSED'); @@ -1062,7 +1062,7 @@ describe('The node_redis client', function () { assert.equal(err.code, 'ECONNREFUSED'); if (typeof err.errno === 'number') { // >= Node 13 - assert.equal(err.errno, util.getSystemErrorName(err.errno)); + assert.equal(util.getSystemErrorName(err.errno), 'ECONNREFUSED'); } else { // < Node 13 assert.equal(err.errno, 'ECONNREFUSED'); @@ -1154,7 +1154,7 @@ describe('The node_redis client', function () { assert.equal(err.code, 'ECONNREFUSED'); if (typeof err.errno === 'number') { // >= Node 13 - assert.equal(err.errno, util.getSystemErrorName(err.errno)); + assert.equal(util.getSystemErrorName(err.errno), 'ECONNREFUSED'); } else { // < Node 13 assert.equal(err.errno, 'ECONNREFUSED'); From 6ce845f620bc5b0aa6d4704492fe27365347d60f Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 01:23:17 +0000 Subject: [PATCH 15/18] chore: set package min node version to >=v4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 827083920e..3cedc98b8f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "redis-parser": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4.0.0" }, "devDependencies": { "bluebird": "^3.0.2", From caaae9c97f8756b0c476b5467613ba126e9f17c7 Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 01:24:25 +0000 Subject: [PATCH 16/18] chore: update denque to v1.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3cedc98b8f..015b93a8c7 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "compare": "node benchmarks/diff_multi_bench_output.js beforeBench.txt afterBench.txt" }, "dependencies": { - "denque": "^1.2.3", + "denque": "^1.4.1", "redis-commands": "^1.5.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0" From 3569a68f5df7df910e9b3961f3bd66fb49ba3210 Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 01:46:35 +0000 Subject: [PATCH 17/18] tests: fix test on windows --- test/node_redis.spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 317723f56a..a77c5146a8 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -360,7 +360,11 @@ describe('The node_redis client', function () { it('send_command with callback as args', function (done) { client.send_command('abcdef', function (err, res) { - assert.strictEqual(err.message, 'ERR unknown command `abcdef`, with args beginning with: '); + if (process.platform === 'win32') { + assert.strictEqual(err.message, 'ERR unknown command `abcdef`'); + } else { + assert.strictEqual(err.message, 'ERR unknown command `abcdef`, with args beginning with: '); + } done(); }); }); From feb4652ad246c488498dd1d0371981354c0a751a Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Feb 2020 01:48:23 +0000 Subject: [PATCH 18/18] tests: disable node > 12 tests on windows, nyc fails to launch nyc needs upgrading to v15, but v15 only works in node versions that support let/const --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 42155ac1d2..d9cd4f4b63 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,9 @@ environment: - nodejs_version: "4" - nodejs_version: "6" - nodejs_version: "8" - - nodejs_version: "12" - - nodejs_version: "13" + - nodejs_version: "10" +# - nodejs_version: "12" +# - nodejs_version: "13" pull_requests: do_not_increment_build_number: true