r3b / grunt-protractor-coverage

Coverage analysis for Protractor tests
Apache License 2.0
38 stars 29 forks source link

Grunt async is marked as done, before getCoverageData is finished #60

Closed mdasberg closed 8 years ago

mdasberg commented 8 years ago

The protractor_coverage task configured in protractor_coverage.js spawns the protractor process.

Once the process is completed an async call is done to fetch the coverage data, but the tasks is marked as done, before the call has finished.

getCoverageData(function(payload){
   try{
      var filename=path.normalize([coverageDir,'/coverage.json'].join(''));
      fs.writeFileSync(filename, payload);
   } catch(e){
      grunt.log.error("Got error: " + e.message);
   }
});
done();
done = null;
justusromijn commented 8 years ago

+1