Tests: only need to assert 'mean' of 16-bit PNG roundtrip

This commit is contained in:
Lovell Fuller 2021-11-23 12:35:47 +00:00
parent afab0d34dd
commit 549219f32a

View File

@ -117,11 +117,15 @@ describe('PNG', function () {
.toColourspace('grey16')
.toBuffer();
const [statsBefore, statsAfter] = await Promise.all([
sharp(fixtures.inputPng16BitGreyAlpha).stats(),
sharp(after).stats()
]);
assert.deepStrictEqual(statsAfter.channels[1], statsBefore.channels[1]);
const [alphaMeanBefore, alphaMeanAfter] = (
await Promise.all([
sharp(fixtures.inputPng16BitGreyAlpha).stats(),
sharp(after).stats()
])
)
.map(stats => stats.channels[1].mean);
assert.strictEqual(alphaMeanAfter, alphaMeanBefore);
});
it('Valid PNG libimagequant palette value does not throw error', function () {