1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Fix some tests and deactivate broken ones

This commit is contained in:
Ruben Bridgewater
2015-09-01 21:47:15 +02:00
parent ba779ac361
commit 1ae280dcec
6 changed files with 14 additions and 93 deletions

View File

@@ -188,15 +188,12 @@ describe("The node_redis client", function () {
// Does not pass.
// "Connection in subscriber mode, only subscriber commands may be used"
it("reconnects, unsubscribes, and can retrieve the pre-existing data", function (done) {
client.on("reconnecting", function on_recon(params) {
client.on("ready", function on_connect() {
client.unsubscribe(helper.isNotError());
client.on("ready", function on_connect() {
client.unsubscribe(helper.isNotError());
client.on('unsubscribe', function (channel, count) {
// we should now be out of subscriber mode.
client.set('foo', 'bar', helper.isNumber(1));
return done();
});
client.on('unsubscribe', function (channel, count) {
// we should now be out of subscriber mode.
client.set('foo', 'bar', helper.isString('OK', done));
});
});
@@ -207,41 +204,6 @@ describe("The node_redis client", function () {
client.stream.destroy();
});
});
it("remains subscribed", function () {
var client2 = redis.createClient.apply(redis.createClient, args);
client.on("reconnecting", function on_recon(params) {
client.on("ready", function on_connect() {
async.parallel([function (cb) {
client.on("message", function (channel, message) {
try {
helper.isString("recon channel")(null, channel);
helper.isString("a test message")(null, message);
} catch (err) {
cb(err);
}
});
client2.subscribe("recon channel", function (err, res) {
if (err) {
cb(err);
return;
}
client2.publish("recon channel", "a test message");
});
}], function (err, results) {
done(err);
});
});
});
client.subscribe("recon channel", function (err, res) {
// Do not do this in normal programs. This is to simulate the server closing on us.
// For orderly shutdown in normal programs, do client.quit()
client.stream.destroy();
});
});
});
describe('domain', function () {