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

Add more tests

Add execution order tests
Fix flaky test
Add utils tests
Improve other tests
This commit is contained in:
Ruben Bridgewater
2016-02-25 02:37:42 +01:00
parent 614e35ab57
commit 4f3c4a2ef6
7 changed files with 210 additions and 12 deletions

View File

@@ -63,11 +63,16 @@ describe("The 'batch' method", function () {
client.end(true);
});
it("returns an empty array", function (done) {
it("returns an empty array and keep the execution order in takt", function (done) {
var called = false;
client.set('foo', 'bar', function (err, res) {
called = true;
});
var batch = client.batch();
batch.exec(function (err, res) {
assert.strictEqual(err, null);
assert.strictEqual(res.length, 0);
assert(called);
done();
});
});
@@ -328,10 +333,11 @@ describe("The 'batch' method", function () {
.exec(done);
});
it("should work without any callback", function (done) {
it("should work without any callback or arguments", function (done) {
var batch = client.batch();
batch.set("baz", "binary");
batch.set("foo", "bar");
batch.ping();
batch.exec();
client.get('foo', helper.isString('bar', done));