From 8e04e4b07f42c33f7d9044a753023a71add62e8d Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sun, 27 Oct 2019 19:54:11 +0000 Subject: [PATCH] Tests: add coverage for tiff quality option --- test/unit/tiff.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unit/tiff.js b/test/unit/tiff.js index 93363804..97e71bd4 100644 --- a/test/unit/tiff.js +++ b/test/unit/tiff.js @@ -85,6 +85,19 @@ describe('TIFF', function () { }); }); + it('Increasing TIFF quality increases file size', () => + sharp(fixtures.inputJpgWithLandscapeExif1) + .tiff({ quality: 40 }) + .toBuffer() + .then(tiff40 => sharp(fixtures.inputJpgWithLandscapeExif1) + .tiff({ quality: 90 }) + .toBuffer() + .then(tiff90 => + assert.strictEqual(true, tiff40.length < tiff90.length) + ) + ) + ); + it('Invalid TIFF quality throws error', function () { assert.throws(function () { sharp().tiff({ quality: 101 });