You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
chore: use standard
This commit is contained in:
@@ -1,56 +1,53 @@
|
||||
'use strict';
|
||||
'use strict'
|
||||
|
||||
var config = require('../lib/config');
|
||||
var helper = require('../helper');
|
||||
var redis = config.redis;
|
||||
var config = require('../lib/config')
|
||||
var helper = require('../helper')
|
||||
var redis = config.redis
|
||||
|
||||
describe("The 'type' method", function () {
|
||||
describe('The \'type\' method', function () {
|
||||
helper.allTests(function (ip, args) {
|
||||
describe('using ' + ip, function () {
|
||||
var client
|
||||
|
||||
helper.allTests(function (ip, args) {
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(null, args)
|
||||
client.once('ready', function () {
|
||||
client.flushdb(done)
|
||||
})
|
||||
})
|
||||
|
||||
describe('using ' + ip, function () {
|
||||
var client;
|
||||
it('reports string type', function (done) {
|
||||
client.set(['string key', 'should be a string'], helper.isString('OK'))
|
||||
client.type(['string key'], helper.isString('string', done))
|
||||
})
|
||||
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(null, args);
|
||||
client.once('ready', function () {
|
||||
client.flushdb(done);
|
||||
});
|
||||
});
|
||||
it('reports list type', function (done) {
|
||||
client.rpush(['list key', 'should be a list'], helper.isNumber(1))
|
||||
client.type(['list key'], helper.isString('list', done))
|
||||
})
|
||||
|
||||
it('reports string type', function (done) {
|
||||
client.set(['string key', 'should be a string'], helper.isString('OK'));
|
||||
client.type(['string key'], helper.isString('string', done));
|
||||
});
|
||||
it('reports set type', function (done) {
|
||||
client.sadd(['set key', 'should be a set'], helper.isNumber(1))
|
||||
client.type(['set key'], helper.isString('set', done))
|
||||
})
|
||||
|
||||
it('reports list type', function (done) {
|
||||
client.rpush(['list key', 'should be a list'], helper.isNumber(1));
|
||||
client.type(['list key'], helper.isString('list', done));
|
||||
});
|
||||
it('reports zset type', function (done) {
|
||||
client.zadd('zset key', ['10.0', 'should be a zset'], helper.isNumber(1))
|
||||
client.type(['zset key'], helper.isString('zset', done))
|
||||
})
|
||||
|
||||
it('reports set type', function (done) {
|
||||
client.sadd(['set key', 'should be a set'], helper.isNumber(1));
|
||||
client.type(['set key'], helper.isString('set', done));
|
||||
});
|
||||
it('reports hash type', function (done) {
|
||||
client.hset('hash key', 'hashtest', 'should be a hash', helper.isNumber(1))
|
||||
client.type(['hash key'], helper.isString('hash', done))
|
||||
})
|
||||
|
||||
it('reports zset type', function (done) {
|
||||
client.zadd('zset key', ['10.0', 'should be a zset'], helper.isNumber(1));
|
||||
client.type(['zset key'], helper.isString('zset', done));
|
||||
});
|
||||
it('reports none for null key', function (done) {
|
||||
client.type('not here yet', helper.isString('none', done))
|
||||
})
|
||||
|
||||
it('reports hash type', function (done) {
|
||||
client.hset('hash key', 'hashtest', 'should be a hash', helper.isNumber(1));
|
||||
client.type(['hash key'], helper.isString('hash', done));
|
||||
});
|
||||
|
||||
it('reports none for null key', function (done) {
|
||||
client.type('not here yet', helper.isString('none', done));
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
client.end(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
afterEach(function () {
|
||||
client.end(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user