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

Add some more tests

This commit is contained in:
Ruben Bridgewater
2015-09-19 18:01:22 +02:00
parent 40c037eaf4
commit 2293f7ff85
4 changed files with 5 additions and 2 deletions

View File

@ -57,7 +57,8 @@ describe("The 'select' method", function () {
describe("with a valid db index", function () {
it("selects the appropriate database", function (done) {
assert.strictEqual(client.selected_db, null, "default db should be null");
client.select(1, function () {
client.select(1, function (err) {
assert.equal(err, null);
assert.equal(client.selected_db, 1, "we should have selected the new valid DB");
return done();
});
@ -68,6 +69,7 @@ describe("The 'select' method", function () {
it("returns an error", function (done) {
assert.strictEqual(client.selected_db, null, "default db should be null");
client.select(9999, function (err) {
assert.equal(err.code, 'ERR');
assert.equal(err.message, 'ERR invalid DB index');
return done();
});