Skip to content

Commit

Permalink
Verified that no error event was firing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Mar 21, 2013
1 parent 6e1dfc8 commit 3fad104
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/node_v0.10.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ else {


it('should trigger the callback for each of 10 db calls', function(cb) {
connectToMemDb(function (err, db) {
if (err) return cb(err);
connectToMemDb(function (count, db) {
db.on('error', function (err) {
return cb(err);
});

async.eachSeries(_.range(10),function (i,cb) {
setSample(db,cb);
Expand All @@ -24,8 +26,10 @@ else {


it('should trigger the callback if provided', function(cb) {
connectToMemDb(function (err, db) {
if (err) return cb(err);
connectToMemDb(function (count, db) {
db.on('error', function (err) {
return cb(err);
});
setSample(db,cb);
});
});
Expand All @@ -36,18 +40,27 @@ else {

it('should trigger the callback if provided', function(cb) {
connectToDiskDb(function (count, db) {
db.on('error', function (err) {
return cb(err);
});
setSample(db,cb);
});
});

it('should work again as long as a fresh connection is used', function(cb) {
connectToDiskDb(function (count, db) {
db.on('error', function (err) {
return cb(err);
});
setSample(db,cb);
});
});

it('callback should fire each time if set() is used multiple times over the same db connection', function(cb) {
connectToDiskDb(function (count, db) {
db.on('error', function (err) {
return cb(err);
});
async.eachSeries(_.range(2),function (i,cb) {
setSample(db, cb);
}, cb);
Expand Down

0 comments on commit 3fad104

Please sign in to comment.