Browse Source

fix merge, run linting as part of the test suite

greenkeeper-update-all
Benjamin Coe 9 years ago
parent
commit
0b46a69c7e
  1. 1
      package.json
  2. 2
      test/commands/client.spec.js
  3. 2
      test/commands/eval.spec.js
  4. 34
      test/commands/multi.spec.js
  5. 2
      test/helper.js
  6. 27
      test/lib/redis-process.js

1
package.json

@ -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": {

2
test/commands/client.spec.js

@ -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);
});
});

2
test/commands/eval.spec.js

@ -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);
});
});

34
test/commands/multi.spec.js

@ -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");

2
test/helper.js

@ -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) {

27
test/lib/redis-process.js

@ -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

Loading…
Cancel
Save