Standardise HEIF effort option name, deprecate speed

This commit is contained in:
Lovell Fuller
2021-11-24 19:54:04 +00:00
parent 2b1f5cbe07
commit e1ba2a7fd8
8 changed files with 50 additions and 29 deletions

View File

@@ -50,6 +50,21 @@ describe('HEIF', () => {
sharp().heif({ compression: 1 });
});
});
it('valid effort does not throw an error', () => {
assert.doesNotThrow(() => {
sharp().heif({ speed: 6 });
});
});
it('out of range effort should throw an error', () => {
assert.throws(() => {
sharp().heif({ effort: 10 });
});
});
it('invalid effort should throw an error', () => {
assert.throws(() => {
sharp().heif({ effort: 'fail' });
});
});
it('valid speed does not throw an error', () => {
assert.doesNotThrow(() => {
sharp().heif({ speed: 6 });
@@ -62,7 +77,7 @@ describe('HEIF', () => {
});
it('invalid speed should throw an error', () => {
assert.throws(() => {
sharp().heif({ compression: 'fail' });
sharp().heif({ speed: 'fail' });
});
});
it('invalid chromaSubsampling should throw an error', () => {