mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Add test for Promise rejection path
This commit is contained in:
parent
e1b5574c4a
commit
940b6f505f
@ -122,6 +122,15 @@ describe('Image metadata', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('Non-existent file in, Promise out', function(done) {
|
||||
sharp('fail').metadata().then(function(metadata) {
|
||||
throw new Error('Non-existent file');
|
||||
}, function (err) {
|
||||
assert.ok(!!err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('Stream in, Promise out', function(done) {
|
||||
var readable = fs.createReadStream(fixtures.inputJpg);
|
||||
var pipeline = sharp();
|
||||
|
Loading…
x
Reference in New Issue
Block a user