You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
fix merge, run linting as part of the test suite
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
"optional-dev-dependency": "^1.0.1",
|
||||
"tcp-port-used": "^0.1.2",
|
||||
"uuid": "^2.0.1",
|
||||
"uuid": "^2.0.1",
|
||||
"win-spawn": "^2.0.0"
|
||||
},
|
||||
"repository": {
|
||||
|
@@ -17,7 +17,7 @@ describe("The 'client' method", function () {
|
||||
client = redis.createClient.apply(redis.createClient, args);
|
||||
client.once("error", done);
|
||||
client.once("connect", function () {
|
||||
client.flushdb(done)
|
||||
client.flushdb(done);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -17,7 +17,7 @@ describe("The 'eval' method", function () {
|
||||
client = redis.createClient.apply(redis.createClient, args);
|
||||
client.once("error", done);
|
||||
client.once("connect", function () {
|
||||
client.flushdb(done)
|
||||
client.flushdb(done);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -89,38 +89,6 @@ describe("The 'multi' method", function () {
|
||||
});
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
// I'm unclear as to the difference between this test in the test above,
|
||||
// perhaps @mranney can clarify?
|
||||
it('roles back a transaction when an error was provoked at queue time', function (done) {
|
||||
var multi1 = client.multi();
|
||||
multi1.mset("multifoo_8", "10", "multibar_8", "20", helper.isString("OK"));
|
||||
multi1.set("foo2", helper.isError());
|
||||
multi1.set("foo3", helper.isError());
|
||||
multi1.incr("multifoo_8", helper.isNumber(11));
|
||||
multi1.incr("multibar_8", helper.isNumber(21));
|
||||
multi1.exec(function () {
|
||||
// Redis 2.6.5+ will abort transactions with errors
|
||||
// see: http://redis.io/topics/transactions
|
||||
var multibar_expected = 22;
|
||||
var multifoo_expected = 12;
|
||||
if (helper.serverVersionAtLeast(client, [2, 6, 5])) {
|
||||
multibar_expected = 1;
|
||||
multifoo_expected = 1;
|
||||
}
|
||||
|
||||
// Confirm that the previous command, while containing an error, still worked.
|
||||
var multi2 = client.multi();
|
||||
multi2.incr("multibar_8", helper.isNumber(multibar_expected));
|
||||
multi2.incr("multifoo_8", helper.isNumber(multifoo_expected));
|
||||
multi2.exec(function (err, replies) {
|
||||
assert.strictEqual(multibar_expected, replies[0]);
|
||||
assert.strictEqual(multifoo_expected, replies[1]);
|
||||
return done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('roles back a transaction when one command in an array of commands fails', function (done) {
|
||||
// test nested multi-bulk replies
|
||||
client.multi([
|
||||
@@ -227,7 +195,7 @@ describe("The 'multi' method", function () {
|
||||
});
|
||||
|
||||
it('reports multiple exceptions when they occur', function (done) {
|
||||
helper.serverVersionAtLeast.bind(this)(client, [2, 6, 5])
|
||||
helper.serverVersionAtLeast.bind(this)(client, [2, 6, 5]);
|
||||
|
||||
client.multi().set("foo").exec(function (err, reply) {
|
||||
assert(Array.isArray(err), "err should be an array");
|
||||
|
@@ -112,7 +112,7 @@ module.exports = {
|
||||
var protocols = ['IPv4'];
|
||||
if (process.platform !== 'win32') {
|
||||
parsers.push('hiredis');
|
||||
protocols.push('IPv6')
|
||||
protocols.push('IPv6');
|
||||
}
|
||||
|
||||
parsers.forEach(function (parser) {
|
||||
|
@@ -11,6 +11,8 @@ var tcpPortUsed = require('tcp-port-used');
|
||||
// wait for redis to be listening in
|
||||
// all three modes (ipv4, ipv6, socket).
|
||||
function waitForRedis (available, cb) {
|
||||
if (process.platform === 'win32') return cb();
|
||||
|
||||
var ipV4 = false;
|
||||
var id = setInterval(function () {
|
||||
tcpPortUsed.check(config.PORT, '127.0.0.1')
|
||||
@@ -38,7 +40,7 @@ module.exports = {
|
||||
// the user running the test some directions.
|
||||
rp.once("exit", function (code) {
|
||||
if (code !== 0) spawnFailed = true;
|
||||
})
|
||||
});
|
||||
|
||||
// wait for redis to become available, by
|
||||
// checking the port we bind on.
|
||||
@@ -66,26 +68,3 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// wait for redis to be listening in
|
||||
// all three modes (ipv4, ipv6, socket).
|
||||
function waitForRedis (available, cb) {
|
||||
if (process.platform === 'win32') return cb();
|
||||
|
||||
var ipV4 = false;
|
||||
var id = setInterval(function () {
|
||||
tcpPortUsed.check(config.PORT, '127.0.0.1')
|
||||
.then(function (_ipV4) {
|
||||
ipV4 = _ipV4;
|
||||
return tcpPortUsed.check(config.PORT, '::1');
|
||||
})
|
||||
.then(function (ipV6) {
|
||||
if (ipV6 === available && ipV4 === available &&
|
||||
fs.existsSync('/tmp/redis.sock') === available) {
|
||||
clearInterval(id);
|
||||
return cb();
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
>>>>>>> down to one failing test on Windows, time to rebase
|
||||
|
Reference in New Issue
Block a user