var CountDownLatch = require('../../lib/util/countDownLatch'); var should = require('should'); var cbCreator = (function() { var count =0; return { callback: function() { count++; }, getCount: function() { return count; }, count: count }; })(); describe('countdown latch test', function() { var countDownLatch1; var countDownLatch2; describe('#count down', function() { it('should invoke the callback after the done method was invoked the specified times', function(done) { var n = 3, doneCount = 0; var cdl = CountDownLatch.createCountDownLatch(n, function() { doneCount.should.equal(n); done(); }); for(var i=0; i