Simplify 'this' in IO pipeline using arrow functions

This commit is contained in:
Lovell Fuller
2019-07-26 19:19:21 +01:00
parent 233b015d77
commit 6cf0b3240d
4 changed files with 67 additions and 65 deletions

View File

@@ -392,6 +392,22 @@ describe('Input/output', function () {
});
});
it('Stream input with corrupt header fails gracefully', function (done) {
const transformer = sharp();
transformer
.toBuffer()
.then(function () {
done(new Error('Unexpectedly resolved Promise'));
})
.catch(function (err) {
assert.strictEqual(true, !!err);
done();
});
fs
.createReadStream(fixtures.inputJpgWithCorruptHeader)
.pipe(transformer);
});
describe('Output filename with unknown extension', function () {
it('Match JPEG input', function (done) {
sharp(fixtures.inputJpg)