Skip to content

Commit

Permalink
test: update test for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed May 7, 2016
1 parent 63806f9 commit 8a84482
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/functional/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@ describe('auth', function () {
}
});
var redis = new Redis({ port: 17379, password: 'pass' });
var pending = 2;
function check() {
if (!--pending) {
redis.disconnect();
server.disconnect();
done();
}
}
redis.on('error', function (error) {
expect(error).to.have.property('message', 'ERR invalid password');
redis.disconnect();
server.disconnect();
done();
check();
});
redis.get('foo', function (err, res) {
expect(err.message).to.eql('ERR invalid password');
check();
});
});

Expand Down

0 comments on commit 8a84482

Please sign in to comment.