mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Tests: reduce flakiness of withIccProfile warning check
This commit is contained in:
parent
7fbb988180
commit
f7ed9b7fb6
@ -641,13 +641,13 @@ describe('Image metadata', function () {
|
||||
.png()
|
||||
.withIccProfile(fixtures.path('invalid-illuminant.icc'));
|
||||
|
||||
let warningEmitted = '';
|
||||
const warningsEmitted = [];
|
||||
img.on('warning', (warning) => {
|
||||
warningEmitted = warning;
|
||||
warningsEmitted.push(warning);
|
||||
});
|
||||
|
||||
const data = await img.toBuffer();
|
||||
assert.strictEqual('Invalid profile', warningEmitted);
|
||||
assert.strict(warningsEmitted.includes('Invalid profile'));
|
||||
|
||||
const metadata = await sharp(data).metadata();
|
||||
assert.strictEqual(3, metadata.channels);
|
||||
|
Loading…
x
Reference in New Issue
Block a user