Add test for Promise rejection path

This commit is contained in:
Lovell Fuller 2014-12-04 10:48:45 +00:00
parent e1b5574c4a
commit 940b6f505f

View File

@ -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();