title: How to avoid deep nesting in nodejs tests?
body: <p>would you mind sharing your best practices in testing nodejs?</p>
  
  <p>What is your experience in order to avoid deep nesting? Could not figure out how to refactor this code to closures when writing test.</p>
  
  <pre><code>describe('ProcessRawData', function(){
    describe('event that has been already handled', function(){
      beforeEach(function(done){
        store.testMode(true);
        var filename = __dirname + '/data/test.txt';
        fs.readFile(filename, 'utf8', function(err, rawData) {
          prd.process(rawData, function(err, data){
          var rawMsgSha1 = '123464fbcb34c333f4300a88f019f43e7de757d6'; 
          store.sismember('events:handled', rawMsgSha1, function(err, exists){
            if (err) throw err;
            assert.ok(exists);
            done();
        });
      });
    });
  })
  </code></pre>