Wrap flapping event test in nextTick

This commit is contained in:
Lovell Fuller 2015-04-21 13:22:29 +01:00
parent dacd62428e
commit 21ba1dfc26

View File

@ -804,9 +804,9 @@ describe('Input/output', function() {
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(320, 240) .resize(320, 240)
.toBuffer(function(err) { .toBuffer(function(err) {
sharp.queue.removeListener('change', queueListener);
if (err) throw err;
process.nextTick(function() { process.nextTick(function() {
sharp.queue.removeListener('change', queueListener);
if (err) throw err;
assert.strictEqual(2, eventCounter); assert.strictEqual(2, eventCounter);
done(); done();
}); });