You've already forked node-redis
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:
5
test.js
5
test.js
@@ -326,7 +326,8 @@ tests.FWD_ERRORS_1 = function () {
|
|||||||
var toThrow = new Error("Forced exception");
|
var toThrow = new Error("Forced exception");
|
||||||
var recordedError = null;
|
var recordedError = null;
|
||||||
|
|
||||||
var originalHandler = client3.listeners("error").pop();
|
var originalHandlers = client3.listeners("error");
|
||||||
|
client3.removeAllListeners("error");
|
||||||
client3.once("error", function (err) {
|
client3.once("error", function (err) {
|
||||||
recordedError = err;
|
recordedError = err;
|
||||||
});
|
});
|
||||||
@@ -342,7 +343,7 @@ tests.FWD_ERRORS_1 = function () {
|
|||||||
|
|
||||||
client.publish(name, "Some message");
|
client.publish(name, "Some message");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
client3.listeners("error").push(originalHandler);
|
client3.listeners("error").push(originalHandlers);
|
||||||
assert.equal(recordedError, toThrow, "Should have caught our forced exception");
|
assert.equal(recordedError, toThrow, "Should have caught our forced exception");
|
||||||
next(name);
|
next(name);
|
||||||
}, 150);
|
}, 150);
|
||||||
|
Reference in New Issue
Block a user