Fix Node.js CI

After the Rust 1.78 release, napi-rs panics on zero-sized array buffers.

Work around it by not allocating a zero-sized array buffer for this specific test.

Upstream PR: napi-rs/napi-rs#2083
This commit is contained in:
Simon Hausmann 2024-05-03 14:10:52 +02:00 committed by Simon Hausmann
parent 11b9d73762
commit af070f306f

View file

@ -217,9 +217,9 @@ test('get/set image properties', async (t) => {
message: "Cannot convert object to image, because the provided object does not have an u32 `height` property"
});
t.throws(() => {
instance!.setProperty("external-image", { width: 1, height: 1, data: new Uint8ClampedArray() });
instance!.setProperty("external-image", { width: 1, height: 1, data: new Uint8ClampedArray(1) });
}, {
message: "data property does not have the correct size; expected 1 (width) * 1 (height) * 4 = 0; got 4"
message: "data property does not have the correct size; expected 1 (width) * 1 (height) * 4 = 1; got 4"
});
t.is(image.bitmap.width, 64);