1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Remove async dependency

This commit is contained in:
Ruben Bridgewater
2015-09-04 17:05:38 +02:00
parent c947e8ff3a
commit 43e25e73c9
4 changed files with 24 additions and 47 deletions

View File

@@ -1,6 +1,5 @@
'use strict';
var async = require('async');
var assert = require('assert');
var config = require("../lib/config");
var helper = require('../helper');
@@ -57,29 +56,16 @@ describe("The 'flushdb' method", function () {
});
describe("when there is data in Redis", function () {
var oldSize;
beforeEach(function (done) {
async.parallel([function (next) {
client.mset(key, uuid.v4(), key2, uuid.v4(), function (err, res) {
helper.isNotError()(err, res);
next(err);
});
}, function (next) {
client.dbsize([], function (err, res) {
helper.isType.positiveNumber()(err, res);
oldSize = res;
next(err);
});
}], function (err) {
if (err) {
return done(err);
}
client.FLUSHDB(function (err, res) {
helper.isString("OK")(err, res);
done(err);
});
var end = helper.callFuncAfter(function () {
client.flushdb(helper.isString("OK", done));
}, 2);
client.mset(key, uuid.v4(), key2, uuid.v4(), helper.isNotError(end));
client.dbsize([], function (err, res) {
helper.isType.positiveNumber()(err, res);
assert.equal(res, 2, 'Two keys should have been inserted');
end();
});
});