You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Deprecate and warn on null / undefined arguments
This commit is contained in:
@@ -43,7 +43,6 @@ describe("The 'incr' method", function () {
|
||||
describe("when connected and a value in Redis", function () {
|
||||
var client;
|
||||
|
||||
// Also, why tf were these disabled for hiredis? They work just fine.
|
||||
before(function (done) {
|
||||
/*
|
||||
9007199254740992 -> 9007199254740992
|
||||
|
@@ -113,7 +113,7 @@ describe("The 'set' method", function () {
|
||||
describe("with undefined 'key' and missing 'value' parameter", function () {
|
||||
it("emits an error without callback", function (done) {
|
||||
client.on('error', function (err) {
|
||||
assert.equal(err.message, 'send_command: SET value must not be undefined or null');
|
||||
assert.equal(err.message, "ERR wrong number of arguments for 'set' command");
|
||||
assert.equal(err.command, 'SET');
|
||||
done();
|
||||
});
|
||||
@@ -132,13 +132,10 @@ describe("The 'set' method", function () {
|
||||
|
||||
it("emit an error without any parameters", function (done) {
|
||||
client.once("error", function (err) {
|
||||
assert.equal(err.message, 'send_command: SET value must not be undefined or null');
|
||||
assert.equal(err.message, "ERR wrong number of arguments for 'set' command");
|
||||
assert.equal(err.command, 'SET');
|
||||
done();
|
||||
});
|
||||
|
||||
// This was not supported not to throw earlier and was added by the test refactoring
|
||||
// https://github.com/NodeRedis/node_redis/commit/eaca486ab1aecd1329f7452ad2f2255b1263606f
|
||||
client.set();
|
||||
});
|
||||
});
|
||||
|
@@ -21,18 +21,14 @@ describe("The 'setex' method", function () {
|
||||
|
||||
it('sets a key with an expiry', function (done) {
|
||||
client.setex(["setex key", "100", "setex val"], helper.isString("OK"));
|
||||
client.exists(["setex key"], helper.isNumber(1));
|
||||
var buffering = client.exists(["setex key"], helper.isNumber(1));
|
||||
assert(typeof buffering === 'boolean');
|
||||
client.ttl(['setex key'], function (err, ttl) {
|
||||
assert.ok(ttl > 0);
|
||||
assert(ttl > 0);
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
it('returns an error if no value is provided', function (done) {
|
||||
var buffering = client.SETEX(["setex key", "100", undefined], helper.isError(done));
|
||||
assert(typeof buffering === 'boolean');
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
client.end(true);
|
||||
});
|
||||
|
Reference in New Issue
Block a user