Tests: relax truncated PNG test assertion

This commit is contained in:
Lovell Fuller 2022-09-04 11:19:01 +01:00
parent 55c4d8807c
commit 1eb66c0944

View File

@ -23,7 +23,9 @@ describe('failOn', () => {
let isWarningEmitted = false;
sharp(fixtures.inputPngTruncated, { failOn: 'none' })
.on('warning', function (warning) {
assert.ok(['read gave 2 warnings', 'not enough data', 'end of stream'].includes(warning));
assert.ok(
['read gave 2 warnings', 'not enough data', 'end of stream']
.some(m => warning.includes(m)));
isWarningEmitted = true;
})
.resize(32, 24)