mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add level constructor opt for multi-level input #2222
This commit is contained in:
@@ -659,6 +659,19 @@ describe('Input/output', function () {
|
||||
sharp({ pages: '1' });
|
||||
}, /Expected integer between -1 and 100000 for pages but received 1 of type string/);
|
||||
});
|
||||
it('Valid level property', function () {
|
||||
sharp({ level: 1 });
|
||||
});
|
||||
it('Invalid level property (string) throws', function () {
|
||||
assert.throws(function () {
|
||||
sharp({ level: '1' });
|
||||
}, /Expected integer between 0 and 256 for level but received 1 of type string/);
|
||||
});
|
||||
it('Invalid level property (negative) throws', function () {
|
||||
assert.throws(function () {
|
||||
sharp({ level: -1 });
|
||||
}, /Expected integer between 0 and 256 for level but received -1 of type number/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('create new image', function () {
|
||||
|
||||
Reference in New Issue
Block a user