diff --git a/index.js b/index.js index 79af798b50..52a29131cd 100644 --- a/index.js +++ b/index.js @@ -142,7 +142,7 @@ function createParser (self) { err.message += '. Please report this.'; self.ready = false; self.flushAndError({ - message: 'Fatal error encountert. Command aborted.', + message: 'Fatal error encountered. Command aborted.', code: 'NR_FATAL' }, { error: err, @@ -220,7 +220,7 @@ RedisClient.prototype.createStream = function () { /* istanbul ignore next: difficult to test and not important as long as we keep this listener */ this.stream.on('clientError', function (err) { - debug('clientError occured'); + debug('clientError occurred'); self.onError(err); }); @@ -327,7 +327,7 @@ RedisClient.prototype.onError = function (err) { this.connected = false; this.ready = false; - // Only emit the error if the retryStategy option is not set + // Only emit the error if the retryStrategy option is not set if (!this.options.retryStrategy) { this.emit('error', err); } @@ -724,7 +724,7 @@ function handleOfflineCommand (self, commandObj) { self.shouldBuffer = true; } -// Do not call internalSendCommand directly, if you are not absolutly certain it handles everything properly +// Do not call internalSendCommand directly, if you are not absolutely certain it handles everything properly // e.g. monitor / info does not work with internalSendCommand only RedisClient.prototype.internalSendCommand = function (commandObj) { var arg, prefixKeys; diff --git a/lib/commands.js b/lib/commands.js index e1e2f2be70..c488c9fdd5 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -17,7 +17,7 @@ var changeFunctionName = (function () { } }()); -// TODO: Rewrite this including the invidual commands into a Commands class +// TODO: Rewrite this including the individual commands into a Commands class // that provided a functionality to add new commands to the client commands.list.forEach(function (command) { diff --git a/lib/extendedApi.js b/lib/extendedApi.js index e77cd693c1..bcd7125da7 100644 --- a/lib/extendedApi.js +++ b/lib/extendedApi.js @@ -32,9 +32,9 @@ RedisClient.prototype.sendCommand = function (command, args, callback) { // Using the raw multi command is only possible with this function // If the command is not yet added to the client, the internal function should be called right away - // Otherwise we need to redirect the calls to make sure the interal functions don't get skipped + // Otherwise we need to redirect the calls to make sure the internal functions don't get skipped // The internal functions could actually be used for any non hooked function - // but this might change from time to time and at the moment there's no good way to distinguishe them + // but this might change from time to time and at the moment there's no good way to distinguish them // from each other, so let's just do it do it this way for the time being if (command === 'multi' || typeof this[command] !== 'function') { return this.internalSendCommand(new Command(command, args, callback)); @@ -55,7 +55,7 @@ RedisClient.prototype.end = function (flush) { } else if (arguments.length === 0) { this.warn( 'Using .end() without the flush parameter is deprecated and throws from v.3.0.0 on.\n' + - 'Please check the doku (https://github.com/NodeRedis/nodeRedis) and explictly use flush.' + 'Please check the documentation (https://github.com/NodeRedis/nodeRedis) and explicitly use flush.' ); } // Clear retryTimer diff --git a/lib/individualCommands.js b/lib/individualCommands.js index b26d7fb635..4bdf35f1a9 100644 --- a/lib/individualCommands.js +++ b/lib/individualCommands.js @@ -12,12 +12,12 @@ var RedisClient = require('../').RedisClient; Replace built-in redis functions The callback may be hooked as needed. The same does not apply to the rest of the function. - State should not be set outside of the callback if not absolutly necessary. + State should not be set outside of the callback if not absolutely necessary. This is important to make sure it works the same as single command or in a multi context. To make sure everything works with the offline queue use the "callOnWrite" function. This is going to be executed while writing to the stream. - TODO: Implement individal command generation as soon as possible to prevent divergent code + TODO: Implement individual command generation as soon as possible to prevent divergent code on single and multi calls! ********************************************************************************************/ @@ -82,7 +82,7 @@ Multi.prototype.monitor = Multi.prototype.MONITOR = function monitor (callback) function quitCallback (self, callback) { return function (err, res) { if (err && err.code === 'NR_CLOSED') { - // Pretent the quit command worked properly in this case. + // Pretend the quit command worked properly in this case. // Either the quit landed in the offline queue and was flushed at the reconnect // or the offline queue is deactivated and the command was rejected right away // or the stream is not writable @@ -149,7 +149,7 @@ function infoCallback (self, callback) { obj.versions.push(+num); }); } - // Expose info key/vals to users + // Expose info key/values to users self.serverInfo = obj; } else { self.serverInfo = {}; diff --git a/lib/utils.js b/lib/utils.js index 9ecab12f07..df1ef2202b 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -21,7 +21,7 @@ function replyToStrings (reply) { if (reply instanceof Array) { var res = new Array(reply.length); for (var i = 0; i < reply.length; i++) { - // Recusivly call the function as slowlog returns deep nested replies + // Recursively call the function as slowlog returns deep nested replies res[i] = replyToStrings(reply[i]); } return res; @@ -43,9 +43,9 @@ function clone (obj) { } if (Object.prototype.toString.call(obj) === '[object Object]') { copy = {}; - var elems = Object.keys(obj); + var elements = Object.keys(obj); var elem; - while (elem = elems.pop()) { + while (elem = elements.pop()) { copy[elem] = clone(obj[elem]); } return copy; diff --git a/test/batch.spec.js b/test/batch.spec.js index 0c4da7d437..e11a9682ff 100644 --- a/test/batch.spec.js +++ b/test/batch.spec.js @@ -64,7 +64,7 @@ describe("The 'batch' method", function () { client.end(true); }); - it('returns an empty array and keep the execution order in takt', function (done) { + it('returns an empty array and keep the execution order in tact', function (done) { var called = false; client.set('foo', 'bar', function (err, res) { called = true; @@ -78,7 +78,7 @@ describe("The 'batch' method", function () { }); }); - it('runs normal calls inbetween batch', function (done) { + it('runs normal calls in-between batch', function (done) { var batch = client.batch(); batch.set('m1', '123'); client.set('m2', '456', done); diff --git a/test/connection.spec.js b/test/connection.spec.js index 30b74abc05..2e071b8774 100644 --- a/test/connection.spec.js +++ b/test/connection.spec.js @@ -265,6 +265,7 @@ describe('connection tests', function () { describe('when not connected', function () { + // TODO: Fix this test it.skip('emit an error after the socket timeout exceeded the connectTimeout time', function (done) { var connectTimeout = 500; // in ms client = redis.createClient({ diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 4b87cdce88..96bb7a0651 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -933,7 +933,7 @@ describe('The nodeRedis client', function () { }); client.once('ready', function () { client.set('foo', 'bar', function (err, res) { - assert.strictEqual(err.message, 'Fatal error encountert. Command aborted. It might have been processed.'); + assert.strictEqual(err.message, 'Fatal error encountered. Command aborted. It might have been processed.'); assert.strictEqual(err.code, 'NR_FATAL'); assert(err instanceof redis.AbortError); error = err.origin;