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

test fixup

This commit is contained in:
Ruben Bridgewater
2017-05-06 08:16:19 +02:00
parent f1a7bcd735
commit b2613b2270
106 changed files with 2900 additions and 2967 deletions

View File

@@ -1,36 +1,36 @@
'use strict'
var assert = require('assert')
var config = require('../lib/config')
var helper = require('../helper')
var redis = config.redis
const assert = require('assert')
const config = require('../lib/config')
const helper = require('../helper')
const redis = config.redis
describe('The \'hmget\' method', function () {
helper.allTests(function (ip, args) {
describe('using ' + ip, function () {
var client
var hash = 'test hash'
describe('The \'hmget\' method', () => {
helper.allTests((ip, args) => {
describe(`using ${ip}`, () => {
let client
const hash = 'test hash'
beforeEach(function (done) {
beforeEach((done) => {
client = redis.createClient.apply(null, args)
client.once('error', done)
client.once('ready', function () {
client.once('ready', () => {
client.flushdb()
client.hmset(hash, {'0123456789': 'abcdefghij', 'some manner of key': 'a type of value'}, helper.isString('OK', done))
})
})
it('allows keys to be specified using multiple arguments', function (done) {
client.hmget(hash, '0123456789', 'some manner of key', function (err, reply) {
it('allows keys to be specified using multiple arguments', (done) => {
client.hmget(hash, '0123456789', 'some manner of key', (err, reply) => {
assert.strictEqual('abcdefghij', reply[0].toString())
assert.strictEqual('a type of value', reply[1].toString())
return done(err)
})
})
it('allows keys to be specified by passing an array without manipulating the array', function (done) {
var data = ['0123456789', 'some manner of key']
client.hmget(hash, data, function (err, reply) {
it('allows keys to be specified by passing an array without manipulating the array', (done) => {
const data = ['0123456789', 'some manner of key']
client.hmget(hash, data, (err, reply) => {
assert.strictEqual(data.length, 2)
assert.strictEqual('abcdefghij', reply[0].toString())
assert.strictEqual('a type of value', reply[1].toString())
@@ -38,30 +38,30 @@ describe('The \'hmget\' method', function () {
})
})
it('allows keys to be specified by passing an array as first argument', function (done) {
client.hmget([hash, '0123456789', 'some manner of key'], function (err, reply) {
it('allows keys to be specified by passing an array as first argument', (done) => {
client.hmget([hash, '0123456789', 'some manner of key'], (err, reply) => {
assert.strictEqual('abcdefghij', reply[0].toString())
assert.strictEqual('a type of value', reply[1].toString())
return done(err)
})
})
it('allows a single key to be specified in an array', function (done) {
client.hmget(hash, ['0123456789'], function (err, reply) {
it('allows a single key to be specified in an array', (done) => {
client.hmget(hash, ['0123456789'], (err, reply) => {
assert.strictEqual('abcdefghij', reply[0].toString())
return done(err)
})
})
it('allows keys to be specified that have not yet been set', function (done) {
client.hmget(hash, 'missing thing', 'another missing thing', function (err, reply) {
it('allows keys to be specified that have not yet been set', (done) => {
client.hmget(hash, 'missing thing', 'another missing thing', (err, reply) => {
assert.strictEqual(null, reply[0])
assert.strictEqual(null, reply[1])
return done(err)
})
})
afterEach(function () {
afterEach(() => {
client.end(true)
})
})