mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Fail fast for unknown interpolator
This commit is contained in:
@@ -94,15 +94,13 @@ describe('Interpolation', function() {
|
||||
});
|
||||
|
||||
it('unknown interpolator throws', function(done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.interpolateWith('nonexistant')
|
||||
.toBuffer()
|
||||
.catch(function (e) {
|
||||
assert(
|
||||
e.toString().match(/VipsInterpolate: class "nonexistant" not found/)
|
||||
);
|
||||
})
|
||||
.finally(done);
|
||||
var isValid = false;
|
||||
try {
|
||||
sharp().interpolateWith('nonexistant');
|
||||
isValid = true;
|
||||
} catch (e) {}
|
||||
assert(!isValid);
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('Normalization', function () {
|
||||
sharp(fixtures.inputJpgWithLowContrast)
|
||||
.gamma()
|
||||
.greyscale()
|
||||
.normalize()
|
||||
.normalize(true)
|
||||
.raw()
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
|
||||
Reference in New Issue
Block a user