You've already forked node-redis
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:
@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user