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

Improve code coverage by adding tests and removing unnecessary code

This commit is contained in:
Ruben Bridgewater
2015-09-03 21:54:57 +02:00
parent b1e51c8c7b
commit 89e1f6f067
10 changed files with 166 additions and 95 deletions

View File

@@ -92,12 +92,21 @@ module.exports = {
return true;
},
allTests: function (cb) {
['javascript', 'hiredis'].forEach(function (parser) {
cb(parser, "/tmp/redis.sock", config.configureClient(parser, "/tmp/redis.sock"));
['IPv4', 'IPv6'].forEach(function (ip) {
cb(parser, ip, config.configureClient(parser, ip));
[undefined].forEach(function (options) { // add buffer option at some point
describe(options && options.return_buffers ? "returning buffers" : "returning strings", function () {
['hiredis', 'javascript'].forEach(function (parser) {
cb(parser, "/tmp/redis.sock", config.configureClient(parser, "/tmp/redis.sock", options));
['IPv4', 'IPv6'].forEach(function (ip) {
cb(parser, ip, config.configureClient(parser, ip, options));
});
});
});
});
},
removeMochaListener: function () {
var mochaListener = process.listeners('uncaughtException').pop();
process.removeListener('uncaughtException', mochaListener);
return mochaListener;
}
}