You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Standard is not as up to date and still uses a old eslint version. Instead, use the airbnb default with a couple of modifications. All required changes are included.
35 lines
857 B
JavaScript
35 lines
857 B
JavaScript
'use strict'
|
|
|
|
const assert = require('assert')
|
|
const config = require('../lib/config')
|
|
const helper = require('../helper')
|
|
|
|
const { redis } = config
|
|
|
|
describe('The \'smembers\' method', () => {
|
|
helper.allTests((ip, args) => {
|
|
describe(`using ${ip}`, () => {
|
|
let client
|
|
|
|
beforeEach(() => {
|
|
client = redis.createClient.apply(null, args)
|
|
return client.flushdb()
|
|
})
|
|
|
|
it('returns all values in a set', () => {
|
|
client.sadd('foo', 'x').then(helper.isNumber(1))
|
|
client.sadd('foo', 'y').then(helper.isNumber(1))
|
|
return client.smembers('foo').then((values) => {
|
|
assert.strictEqual(values.length, 2)
|
|
const members = values.sort()
|
|
assert.deepStrictEqual(members, ['x', 'y'])
|
|
})
|
|
})
|
|
|
|
afterEach(() => {
|
|
client.end(true)
|
|
})
|
|
})
|
|
})
|
|
})
|