mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add mixed and minSize animation options for WebP output
This commit is contained in:
@@ -139,6 +139,28 @@ describe('WebP', function () {
|
||||
assert.strictEqual(effort, 0);
|
||||
});
|
||||
|
||||
it('valid minSize', () => {
|
||||
assert.doesNotThrow(() => sharp().webp({ minSize: true }));
|
||||
});
|
||||
|
||||
it('invalid minSize throws', () => {
|
||||
assert.throws(
|
||||
() => sharp().webp({ minSize: 1 }),
|
||||
/Expected boolean for webpMinSize but received 1 of type number/
|
||||
);
|
||||
});
|
||||
|
||||
it('valid mixed', () => {
|
||||
assert.doesNotThrow(() => sharp().webp({ mixed: true }));
|
||||
});
|
||||
|
||||
it('invalid mixed throws', () => {
|
||||
assert.throws(
|
||||
() => sharp().webp({ mixed: 'fail' }),
|
||||
/Expected boolean for webpMixed but received fail of type string/
|
||||
);
|
||||
});
|
||||
|
||||
it('invalid loop throws', () => {
|
||||
assert.throws(() => {
|
||||
sharp().webp({ loop: -1 });
|
||||
|
||||
Reference in New Issue
Block a user