Skip to content

Commit 2293f7f

Browse files
author
Ruben Bridgewater
committed
Add some more tests
1 parent 40c037e commit 2293f7f

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,6 @@ Multi.prototype.execute_callback = function (err, replies) {
10601060

10611061
if (err) {
10621062
if (err.code !== 'CONNECTION_BROKEN') {
1063-
err.code = 'EXECABORT';
10641063
err.errors = this.errors;
10651064
if (this.callback) {
10661065
this.callback(err);

test/commands/eval.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ describe("The 'eval' method", function () {
128128
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
129129
client.evalsha('ffffffffffffffffffffffffffffffffffffffff', 0);
130130
client.on('error', function(err) {
131+
assert.equal(err.code, 'NOSCRIPT');
131132
assert(/NOSCRIPT No matching script. Please use EVAL./.test(err.message));
132133
done();
133134
});

test/commands/multi.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ describe("The 'multi' method", function () {
263263
it('reports multiple exceptions when they occur (while EXEC is running)', function (done) {
264264
client.multi().config("bar").debug("foo").exec(function (err, reply) {
265265
assert.strictEqual(reply.length, 2);
266+
assert.equal(reply[0].code, 'ERR');
266267
assert(/^ERR/.test(reply[0].message), "Error message should begin with ERR");
267268
assert(/^ERR/.test(reply[1].message), "Error message should begin with ERR");
268269
return done();

test/commands/select.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ describe("The 'select' method", function () {
5757
describe("with a valid db index", function () {
5858
it("selects the appropriate database", function (done) {
5959
assert.strictEqual(client.selected_db, null, "default db should be null");
60-
client.select(1, function () {
60+
client.select(1, function (err) {
61+
assert.equal(err, null);
6162
assert.equal(client.selected_db, 1, "we should have selected the new valid DB");
6263
return done();
6364
});
@@ -68,6 +69,7 @@ describe("The 'select' method", function () {
6869
it("returns an error", function (done) {
6970
assert.strictEqual(client.selected_db, null, "default db should be null");
7071
client.select(9999, function (err) {
72+
assert.equal(err.code, 'ERR');
7173
assert.equal(err.message, 'ERR invalid DB index');
7274
return done();
7375
});

0 commit comments

Comments
 (0)