Skip to content

Commit

Permalink
test: fail fast when monitor not working
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Oct 8, 2018
1 parent 13a5bc4 commit 6050b0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/functional/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ describe('monitor', function () {
var redis = new Redis();
redis.on('ready', function () {
redis.monitor(function (err, monitor) {
if (err) {
done(err);
return;
}
monitor.on('monitor', function (time, args) {
expect(args[0]).to.eql('get');
expect(args[1]).to.eql('foo');
Expand Down Expand Up @@ -32,6 +36,10 @@ describe('monitor', function () {
it('should continue monitoring after reconnection', function (done) {
var redis = new Redis();
redis.monitor(function (err, monitor) {
if (err) {
done(err);
return;
}
monitor.on('monitor', function (time, args) {
if (args[0] === 'set') {
redis.disconnect();
Expand Down

0 comments on commit 6050b0f

Please sign in to comment.