You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
chore: refactor codebase to promises
This commit is contained in:
@@ -10,24 +10,19 @@ describe('The \'hincrby\' method', () => {
|
||||
let client
|
||||
const hash = 'test hash'
|
||||
|
||||
beforeEach((done) => {
|
||||
beforeEach(() => {
|
||||
client = redis.createClient.apply(null, args)
|
||||
client.once('ready', () => {
|
||||
client.flushdb(done)
|
||||
})
|
||||
return client.flushdb()
|
||||
})
|
||||
|
||||
it('increments a key that has already been set', (done) => {
|
||||
it('increments a key that has already been set', () => {
|
||||
const field = 'field 1'
|
||||
|
||||
client.hset(hash, field, 33)
|
||||
client.hincrby(hash, field, 10, helper.isNumber(43, done))
|
||||
return client.hincrby(hash, field, 10).then(helper.isNumber(43))
|
||||
})
|
||||
|
||||
it('increments a key that has not been set', (done) => {
|
||||
const field = 'field 2'
|
||||
|
||||
client.hincrby(hash, field, 10, helper.isNumber(10, done))
|
||||
it('increments a key that has not been set', () => {
|
||||
return client.hincrby(hash, 'field 2', 10).then(helper.isNumber(10))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
|
Reference in New Issue
Block a user