1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Rename .command_used to .command and add the used command to more errors

This commit is contained in:
Ruben Bridgewater
2015-09-20 18:56:21 +02:00
parent 1f121fa6e2
commit c60a3b65fe
5 changed files with 40 additions and 29 deletions

View File

@@ -156,7 +156,9 @@ describe("The node_redis client", function () {
process.once('uncaughtException', function (err) {
process.on('uncaughtException', mochaListener);
assert(/ERR Protocol error/.test(err));
assert(/ERR Protocol error/.test(err.message));
assert.equal(err.command, true);
assert.equal(err.code, 'ERR');
done();
});
@@ -195,7 +197,7 @@ describe("The node_redis client", function () {
setTimeout(function() {
client.get("foo", function(err, res) {
assert.strictEqual(err.message, 'GET can\'t be processed. The connection has already been closed.');
assert.strictEqual(err.command_used, 'GET');
assert.strictEqual(err.command, 'GET');
assert.strictEqual(client.offline_queue.length, 0);
done();
});
@@ -209,7 +211,7 @@ describe("The node_redis client", function () {
client.quit();
client.on('error', function(err) {
assert.strictEqual(err.message, 'SET can\'t be processed. The connection has already been closed.');
assert.strictEqual(err.command_used, 'SET');
assert.strictEqual(err.command, 'SET');
assert.strictEqual(client.offline_queue.length, 0);
done();
});