You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
chore: refactor codebase to promises
This commit is contained in:
@@ -3,27 +3,21 @@
|
||||
const config = require('../lib/config')
|
||||
const helper = require('../helper')
|
||||
const redis = config.redis
|
||||
const assert = require('assert')
|
||||
|
||||
describe('The \'rpush\' command', () => {
|
||||
helper.allTests((ip, args) => {
|
||||
describe(`using ${ip}`, () => {
|
||||
let client
|
||||
|
||||
beforeEach((done) => {
|
||||
beforeEach(() => {
|
||||
client = redis.createClient.apply(null, args)
|
||||
client.once('ready', () => {
|
||||
client.flushdb(done)
|
||||
})
|
||||
return client.flushdb()
|
||||
})
|
||||
|
||||
it('inserts multiple values at a time into a list', (done) => {
|
||||
client.rpush('test', ['list key', 'should be a list'])
|
||||
client.lrange('test', 0, -1, (err, res) => {
|
||||
assert.strictEqual(res[0], 'list key')
|
||||
assert.strictEqual(res[1], 'should be a list')
|
||||
done(err)
|
||||
})
|
||||
it('inserts multiple values at a time into a list', () => {
|
||||
const list = ['list key', 'should be a list']
|
||||
client.rpush('test', list)
|
||||
return client.lrange('test', 0, -1).then(helper.isDeepEqual(list))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
|
Reference in New Issue
Block a user