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:
@@ -13,31 +13,29 @@ describe('The \'script\' method', () => {
|
||||
describe(`using ${ip}`, () => {
|
||||
let client
|
||||
|
||||
beforeEach((done) => {
|
||||
beforeEach(() => {
|
||||
client = redis.createClient.apply(null, args)
|
||||
client.once('ready', () => {
|
||||
client.flushdb(done)
|
||||
})
|
||||
return client.flushdb()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
client.end(true)
|
||||
})
|
||||
|
||||
it('loads script with client.script(\'load\')', (done) => {
|
||||
client.script('load', command, helper.isString(commandSha, done))
|
||||
it('loads script with client.script(\'load\')', () => {
|
||||
return client.script('load', command).then(helper.isString(commandSha))
|
||||
})
|
||||
|
||||
it('allows a loaded script to be evaluated', (done) => {
|
||||
client.evalsha(commandSha, 0, helper.isNumber(99, done))
|
||||
it('allows a loaded script to be evaluated', () => {
|
||||
return client.evalsha(commandSha, 0).then(helper.isNumber(99))
|
||||
})
|
||||
|
||||
it('allows a script to be loaded as part of a chained transaction', (done) => {
|
||||
client.multi().script('load', command).exec(helper.isDeepEqual([commandSha], done))
|
||||
it('allows a script to be loaded as part of a chained transaction', () => {
|
||||
return client.multi().script('load', command).exec(helper.isDeepEqual([commandSha]))
|
||||
})
|
||||
|
||||
it('allows a script to be loaded using a transaction\'s array syntax', (done) => {
|
||||
client.multi([['script', 'load', command]]).exec(helper.isDeepEqual([commandSha], done))
|
||||
it('allows a script to be loaded using a transaction\'s array syntax', () => {
|
||||
return client.multi([['script', 'load', command]]).exec(helper.isDeepEqual([commandSha]))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user