Ensure ops without multi-page support reject (#3010)

This commit is contained in:
Lovell Fuller
2021-12-12 09:14:26 +00:00
committed by GitHub
parent 5bb6702717
commit 9755629cfd
5 changed files with 81 additions and 1 deletions

View File

@@ -120,6 +120,14 @@ describe('Trim borders', function () {
)
);
it('Animated image rejects', () =>
assert.rejects(() => sharp(fixtures.inputGifAnimated, { animated: true })
.trim()
.toBuffer(),
/Trim is not supported for multi-page images/
)
);
describe('Invalid thresholds', function () {
[-1, 'fail', {}].forEach(function (threshold) {
it(JSON.stringify(threshold), function () {