Pass errors as Error instances rather than strings.

This commit is contained in:
Andreas Lind
2014-10-23 08:27:10 +02:00
parent 49b44d8238
commit 1bd316de80
2 changed files with 8 additions and 1 deletions

View File

@@ -185,4 +185,11 @@ describe('Image metadata', function() {
});
});
it('Report an invalid image as an error', function(done) {
sharp(new Buffer([0x1, 0x2, 0x3, 0x4])).metadata(function (err, metadata) {
assert.ok(err);
assert.ok(err instanceof Error);
done();
});
});
});