Skip to content

Commit

Permalink
Cover an OutputDimensionsExceeded error being passed to next.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjeffburke committed Dec 15, 2023
1 parent b089acd commit ef89ce5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,22 @@ describe('express-processimage', () => {
}),
});
});

it('should refuse to resize an image to exceed the max number of pixels', () => {
config.maxOutputPixels = 2;
return expect(
'GET /bulb.gif?resize=100,100',
'to yield response',
{
errorPassedToNext: expect.it('to satisfy', {
message:
'resize: Target dimensions of 100x100 exceed maxOutputPixels (2)',
name: 'OutputDimensionsExceeded',
OutputDimensionsExceeded: true,
}),
}
);
});
});
});
});
Expand Down

0 comments on commit ef89ce5

Please sign in to comment.