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; let isWarningEmitted = false;
sharp(fixtures.inputPngTruncated, { failOn: 'none' }) sharp(fixtures.inputPngTruncated, { failOn: 'none' })
.on('warning', function (warning) { .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; isWarningEmitted = true;
}) })
.resize(32, 24) .resize(32, 24)