Improve error message for missing file that might be SVG

This commit is contained in:
Lovell Fuller
2022-03-02 09:58:55 +00:00
parent 21a960796c
commit af80d7e389
2 changed files with 11 additions and 0 deletions

View File

@@ -135,4 +135,11 @@ describe('SVG input', function () {
assert.strictEqual(info.height, 240);
assert.strictEqual(info.channels, 4);
});
it('Detects SVG passed as a string', () =>
assert.rejects(
() => sharp('<svg></svg>').toBuffer(),
/Input file is missing, did you mean/
)
);
});