Browse Source

Update changelog and fix a test

internal
Ruben Bridgewater 9 years ago
parent
commit
59984136fe
  1. 6
      changelog.md
  2. 36
      test/pubsub.spec.js

6
changelog.md

@ -1,6 +1,12 @@
Changelog Changelog
========= =========
## v.2.4.2 - 27 Nov, 2015
Bugfixes
- Fixed not emitting ready after reconnect with disable_resubscribing ([@maxgalbu](https://github.com/maxgalbu))
## v.2.4.1 - 25 Nov, 2015 ## v.2.4.1 - 25 Nov, 2015
Bugfixes Bugfixes

36
test/pubsub.spec.js

@ -17,51 +17,32 @@ describe("publish/subscribe", function () {
var message = "test message"; var message = "test message";
beforeEach(function (done) { beforeEach(function (done) {
var pubConnected; var end = helper.callFuncAfter(done, 2);
var subConnected;
pub = redis.createClient.apply(redis.createClient, args); pub = redis.createClient.apply(redis.createClient, args);
sub = redis.createClient.apply(redis.createClient, args); sub = redis.createClient.apply(redis.createClient, args);
pub.once("connect", function () { pub.once("connect", function () {
pub.flushdb(function () { pub.flushdb(function () {
pubConnected = true; end();
if (subConnected) {
done();
}
}); });
}); });
sub.once("connect", function () { sub.once("connect", function () {
subConnected = true; end();
if (pubConnected) {
done();
}
}); });
}); });
describe('disable resubscribe', function () { describe('disable resubscribe', function () {
beforeEach(function (done) { beforeEach(function (done) {
var pubConnected; sub.end(false);
var subConnected;
pub = redis.createClient();
sub = redis.createClient({ sub = redis.createClient({
disable_resubscribing: true disable_resubscribing: true
}); });
pub.once("connect", function () {
pubConnected = true;
if (subConnected) {
done();
}
});
sub.once("connect", function () { sub.once("connect", function () {
subConnected = true; done();
if (pubConnected) {
done();
}
}); });
}); });
it('does not fire subscribe events after reconnecting', function (done) { it.only('does not fire subscribe events after reconnecting', function (done) {
var a = false; var a = false;
sub.on("subscribe", function (chnl, count) { sub.on("subscribe", function (chnl, count) {
if (chnl === channel2) { if (chnl === channel2) {
@ -75,11 +56,12 @@ describe("publish/subscribe", function () {
sub.on('reconnecting', function() { sub.on('reconnecting', function() {
a = true; a = true;
sub.on('ready', function () {
setTimeout(done, 250);
});
}); });
sub.subscribe(channel, channel2); sub.subscribe(channel, channel2);
setTimeout(done, 250);
}); });
}); });

Loading…
Cancel
Save