Ejemplo n.º 1
0
function benchParallelize (done) {
  var next = parallelize(done)

  somethingA(next())
  somethingA(next())
  somethingA(next())
}
Ejemplo n.º 2
0
var siteA = tmpDir + '/siteA.png';
var siteB = tmpDir + '/siteB.png';
var out = tmpDir + '/vis-diff.png';
var renderDelay = (argv.renderDelay) ? parseInt(argv.renderDelay, 10) : 0;
var misMatchPercentage = (argv.mismatch) ? parseInt(argv.mismatch) : -1;

var next = parallelize(function(err) {
  if (err) { throw err; }

  resemble(siteA).compareTo(siteB)
    .ignoreAntialiasing()
    .ignoreColors()
    .onComplete(function(data){
      if ((misMatchPercentage > 0) && (data.misMatchPercentage >= misMatchPercentage)) {
        console.error('Error: missmatch percentage %s', data.misMatchPercentage);
        process.exit(1);
      }

      data.getDiffImage().pack().pipe(fs.createWriteStream(out)).on('close', function() {
        opn(out);
      });
    });
});

var webshotOpts = {
  renderDelay: renderDelay,
  shotSize: {
    width: 'all',
    height: 'all'
  }