Skip to content

Commit b773119

Browse files
committed
the monitor test should not be within the block of tests related to redis closing unexpectedly
1 parent aad5045 commit b773119

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

test/node_redis.spec.js

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -355,42 +355,41 @@ describe("The node_redis client", function () {
355355
}
356356
});
357357
});
358+
});
358359

359-
describe('monitor', function () {
360-
it('monitors commands on all other redis clients', function (done) {
361-
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
362-
363-
var monitorClient = redis.createClient.apply(redis.createClient, args);
364-
var responses = [];
365-
366-
monitorClient.monitor(function (err, res) {
367-
client.mget("some", "keys", "foo", "bar");
368-
client.set("json", JSON.stringify({
369-
foo: "123",
370-
bar: "sdflkdfsjk",
371-
another: false
372-
}));
373-
});
374-
375-
monitorClient.on("monitor", function (time, args) {
376-
responses.push(args);
377-
if (responses.length === 2) {
378-
assert.strictEqual(5, responses[0].length);
379-
assert.strictEqual("mget", responses[0][0]);
380-
assert.strictEqual("some", responses[0][1]);
381-
assert.strictEqual("keys", responses[0][2]);
382-
assert.strictEqual("foo", responses[0][3]);
383-
assert.strictEqual("bar", responses[0][4]);
384-
assert.strictEqual(3, responses[1].length);
385-
assert.strictEqual("set", responses[1][0]);
386-
assert.strictEqual("json", responses[1][1]);
387-
assert.strictEqual('{"foo":"123","bar":"sdflkdfsjk","another":false}', responses[1][2]);
388-
monitorClient.quit(done);
389-
}
390-
});
360+
describe('monitor', function () {
361+
it('monitors commands on all other redis clients', function (done) {
362+
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
363+
364+
var monitorClient = redis.createClient.apply(redis.createClient, args);
365+
var responses = [];
366+
367+
monitorClient.monitor(function (err, res) {
368+
client.mget("some", "keys", "foo", "bar");
369+
client.set("json", JSON.stringify({
370+
foo: "123",
371+
bar: "sdflkdfsjk",
372+
another: false
373+
}));
374+
});
375+
376+
monitorClient.on("monitor", function (time, args) {
377+
responses.push(args);
378+
if (responses.length === 2) {
379+
assert.strictEqual(5, responses[0].length);
380+
assert.strictEqual("mget", responses[0][0]);
381+
assert.strictEqual("some", responses[0][1]);
382+
assert.strictEqual("keys", responses[0][2]);
383+
assert.strictEqual("foo", responses[0][3]);
384+
assert.strictEqual("bar", responses[0][4]);
385+
assert.strictEqual(3, responses[1].length);
386+
assert.strictEqual("set", responses[1][0]);
387+
assert.strictEqual("json", responses[1][1]);
388+
assert.strictEqual('{"foo":"123","bar":"sdflkdfsjk","another":false}', responses[1][2]);
389+
monitorClient.quit(done);
390+
}
391391
});
392392
});
393-
394393
});
395394

396395
describe('idle', function () {

0 commit comments

Comments
 (0)