You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Earlier multi.command and client.command diverged a lot in the way they accepted arguments. This is now consistent This will also fix some bugs like using multi.hmset with arrays
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
var config = require("../lib/config");
|
|
var helper = require("../helper");
|
|
var redis = config.redis;
|
|
|
|
describe("The 'expire' method", function () {
|
|
|
|
helper.allTests(function(parser, ip, args) {
|
|
|
|
describe("using " + parser + " and " + ip, function () {
|
|
var client;
|
|
|
|
beforeEach(function (done) {
|
|
client = redis.createClient.apply(redis.createClient, args);
|
|
client.once("error", done);
|
|
client.once("connect", function () {
|
|
client.flushdb(done);
|
|
});
|
|
});
|
|
|
|
it('expires key after timeout', function (done) {
|
|
client.set(['expiry key', 'bar'], helper.isString("OK"));
|
|
client.EXPIRE("expiry key", "1", helper.isNumber(1));
|
|
setTimeout(function () {
|
|
client.exists(["expiry key"], helper.isNumber(0, done));
|
|
}, 1100);
|
|
});
|
|
|
|
it('expires key after timeout with array syntax', function (done) {
|
|
client.set(['expiry key', 'bar'], helper.isString("OK"));
|
|
client.EXPIRE(["expiry key", "1"], helper.isNumber(1));
|
|
setTimeout(function () {
|
|
client.exists(["expiry key"], helper.isNumber(0, done));
|
|
}, 3000);
|
|
});
|
|
|
|
afterEach(function () {
|
|
client.end();
|
|
});
|
|
});
|
|
});
|
|
});
|