1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

fix fwd errors test for node >= 0.9.1

it seems that listeners are no longer mutable
* events: Make emitter.listeners() side-effect free (isaacs, Joe Andaverde)
https://raw.github.com/joyent/node/v0.9.1/ChangeLog
This commit is contained in:
englandpost
2013-04-05 00:44:06 +04:00
parent b0f7760b19
commit 3e0762e6ec

View File

@@ -326,7 +326,8 @@ tests.FWD_ERRORS_1 = function () {
var toThrow = new Error("Forced exception");
var recordedError = null;
var originalHandler = client3.listeners("error").pop();
var originalHandlers = client3.listeners("error");
client3.removeAllListeners("error");
client3.once("error", function (err) {
recordedError = err;
});
@@ -342,7 +343,7 @@ tests.FWD_ERRORS_1 = function () {
client.publish(name, "Some message");
setTimeout(function () {
client3.listeners("error").push(originalHandler);
client3.listeners("error").push(originalHandlers);
assert.equal(recordedError, toThrow, "Should have caught our forced exception");
next(name);
}, 150);