From ba4ce75377d4e4f810e67a82ef5bc57596e1b2fd Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 29 Jul 2019 11:32:31 +0100 Subject: [PATCH] Ensure all WebP tests wait until Promises resolve --- test/unit/webp.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/webp.js b/test/unit/webp.js index 6d46566b..7921dfdc 100644 --- a/test/unit/webp.js +++ b/test/unit/webp.js @@ -81,15 +81,15 @@ describe('WebP', function () { .resize(320, 240) .webp({ smartSubsample: false }) .toBuffer() - .then(withoutSmartSubsample => { + .then(withoutSmartSubsample => sharp(fixtures.inputJpg) .resize(320, 240) .webp({ smartSubsample: true }) .toBuffer() .then(withSmartSubsample => { assert.strictEqual(true, withSmartSubsample.length > withoutSmartSubsample.length); - }); - }) + }) + ) ); it('invalid smartSubsample throws', () => { @@ -103,15 +103,15 @@ describe('WebP', function () { .resize(320, 240) .webp() .toBuffer() - .then(reductionEffort4 => { + .then(reductionEffort4 => sharp(fixtures.inputJpg) .resize(320, 240) .webp({ reductionEffort: 6 }) .toBuffer() .then(reductionEffort6 => { assert.strictEqual(true, reductionEffort4.length > reductionEffort6.length); - }); - }) + }) + ) ); it('invalid reductionEffort throws', () => {