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') .toColourspace('grey16')
.toBuffer(); .toBuffer();
const [statsBefore, statsAfter] = await Promise.all([ const [alphaMeanBefore, alphaMeanAfter] = (
sharp(fixtures.inputPng16BitGreyAlpha).stats(), await Promise.all([
sharp(after).stats() sharp(fixtures.inputPng16BitGreyAlpha).stats(),
]); sharp(after).stats()
assert.deepStrictEqual(statsAfter.channels[1], statsBefore.channels[1]); ])
)
.map(stats => stats.channels[1].mean);
assert.strictEqual(alphaMeanAfter, alphaMeanBefore);
}); });
it('Valid PNG libimagequant palette value does not throw error', function () { it('Valid PNG libimagequant palette value does not throw error', function () {