From 9a54a034e12e435ab8e06744248ad271132d4fea Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sun, 4 Sep 2022 10:28:24 +0100 Subject: [PATCH] Tests: ensure truncated PNG test handles possible race --- test/unit/failOn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/failOn.js b/test/unit/failOn.js index 21b4eb22..558786f0 100644 --- a/test/unit/failOn.js +++ b/test/unit/failOn.js @@ -23,7 +23,7 @@ describe('failOn', () => { let isWarningEmitted = false; sharp(fixtures.inputPngTruncated, { failOn: 'none' }) .on('warning', function (warning) { - assert.ok(warning.includes('not enough data') || warning.includes('end of stream')); + assert.ok(['read gave 2 warnings', 'not enough data', 'end of stream'].includes(warning)); isWarningEmitted = true; }) .resize(32, 24)