Tests: fix JP2 suite with global libvips (#4477)

This commit is contained in:
Kleis Auke Wolthuizen 2025-11-15 11:55:58 +01:00 committed by GitHub
parent dc6820b49f
commit 3609c61a22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,11 +45,11 @@ describe('JP2 output', () => {
assert.strictEqual('png', info.format); assert.strictEqual('png', info.format);
assert.strictEqual(8, info.width); assert.strictEqual(8, info.width);
assert.strictEqual(15, info.height); assert.strictEqual(15, info.height);
assert.strictEqual(4, info.channels); assert.strictEqual(3, info.channels);
}); });
}); });
it('JP2 quality', (done) => { it('JP2 quality', (_t, done) => {
sharp(fixtures.inputJp2) sharp(fixtures.inputJp2)
.resize(320, 240) .resize(320, 240)
.jp2({ quality: 70 }) .jp2({ quality: 70 })
@ -65,7 +65,7 @@ describe('JP2 output', () => {
}); });
}); });
it('Without chroma subsampling generates larger file', (done) => { it('Without chroma subsampling generates larger file', (_t, done) => {
// First generate with chroma subsampling (default) // First generate with chroma subsampling (default)
sharp(fixtures.inputJp2) sharp(fixtures.inputJp2)
.resize(320, 240) .resize(320, 240)
@ -111,7 +111,7 @@ describe('JP2 output', () => {
it('Invalid JP2 chromaSubsampling value throws error', () => { it('Invalid JP2 chromaSubsampling value throws error', () => {
assert.throws( assert.throws(
() => sharp().jp2({ chromaSubsampling: '4:2:2' }), () => sharp().jp2({ chromaSubsampling: '4:2:2' }),
/Expected one of 4:2:0, 4:4:4 but received 4:2:2 of type string/ /Expected one of: 4:2:0, 4:4:4 for chromaSubsampling but received 4:2:2 of type string/
); );
}); });
} }