You've already forked node-redis
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:
@@ -1,44 +1,44 @@
|
||||
'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 \'watch\' method', function () {
|
||||
helper.allTests(function (ip, args) {
|
||||
var watched = 'foobar'
|
||||
describe('The \'watch\' method', () => {
|
||||
helper.allTests((ip, args) => {
|
||||
const watched = 'foobar'
|
||||
|
||||
describe('using ' + ip, function () {
|
||||
var client
|
||||
describe(`using ${ip}`, () => {
|
||||
let client
|
||||
|
||||
beforeEach(function (done) {
|
||||
beforeEach((done) => {
|
||||
client = redis.createClient.apply(null, args)
|
||||
client.once('ready', function () {
|
||||
client.once('ready', () => {
|
||||
client.flushdb(done)
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
afterEach(() => {
|
||||
client.end(true)
|
||||
})
|
||||
|
||||
it('does not execute transaction if watched key was modified prior to execution', function (done) {
|
||||
it('does not execute transaction if watched key was modified prior to execution', (done) => {
|
||||
client.watch(watched)
|
||||
client.incr(watched)
|
||||
var multi = client.multi()
|
||||
const multi = client.multi()
|
||||
multi.incr(watched)
|
||||
multi.exec(helper.isNull(done))
|
||||
})
|
||||
|
||||
it('successfully modifies other keys independently of transaction', function (done) {
|
||||
it('successfully modifies other keys independently of transaction', (done) => {
|
||||
client.set('unwatched', 200)
|
||||
|
||||
client.set(watched, 0)
|
||||
client.watch(watched)
|
||||
client.incr(watched)
|
||||
|
||||
client.multi().incr(watched).exec(function (err, replies) {
|
||||
client.multi().incr(watched).exec((err, replies) => {
|
||||
assert.strictEqual(err, null)
|
||||
assert.strictEqual(replies, null, 'Aborted transaction multi-bulk reply should be null.')
|
||||
|
||||
|
Reference in New Issue
Block a user