mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Windows: make invalid param errors recoverable by default (#3002)
* Tests: ensure writing to missing directory fails Co-authored-by: Lovell Fuller <github@lovell.info>
This commit is contained in:
committed by
GitHub
parent
add4c7928f
commit
659cdabd8e
@@ -797,6 +797,19 @@ describe('Input/output', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('Fails when writing to missing directory', async () => {
|
||||
const create = {
|
||||
width: 8,
|
||||
height: 8,
|
||||
channels: 3,
|
||||
background: { r: 0, g: 0, b: 0 }
|
||||
};
|
||||
await assert.rejects(
|
||||
() => sharp({ create }).toFile('does-not-exist/out.jpg'),
|
||||
/unable to open for write/
|
||||
);
|
||||
});
|
||||
|
||||
describe('create new image', function () {
|
||||
it('RGB', function (done) {
|
||||
const create = {
|
||||
|
||||
Reference in New Issue
Block a user