Skip to content

Commit 1380ad6

Browse files
committed
fix: test on old node versions
1 parent 6694c91 commit 1380ad6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/node_redis.spec.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ describe('The node_redis client', function () {
2525
var command = 'really-new.command';
2626
assert.strictEqual(Redis.prototype[command], undefined);
2727
redis.addCommand(command);
28-
assert.strictEqual(Redis.prototype[command].name, 'really_new_command');
29-
assert.strictEqual(Redis.prototype[command.toUpperCase()].name, 'really_new_command');
30-
assert.strictEqual(Redis.prototype.really_new_command.name, 'really_new_command');
31-
assert.strictEqual(Redis.prototype.REALLY_NEW_COMMAND.name, 'really_new_command');
28+
if (Redis.prototype[command].name !== '') {
29+
assert.strictEqual(Redis.prototype[command].name, 'really_new_command');
30+
assert.strictEqual(Redis.prototype[command.toUpperCase()].name, 'really_new_command');
31+
assert.strictEqual(Redis.prototype.really_new_command.name, 'really_new_command');
32+
assert.strictEqual(Redis.prototype.REALLY_NEW_COMMAND.name, 'really_new_command');
33+
}
3234
});
3335
});
3436

0 commit comments

Comments
 (0)