1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

LibJS: Use Number instead of parseInt in TypedArray forEach BigInt tests

The Number constructor previously didn't support converting BigInts to
regular numbers, so I used parseInt as a workaround.

Since it now supports this, this workaround is no longer needed.
This commit is contained in:
Luke 2021-07-06 02:27:09 +01:00 committed by Linus Groh
parent 8244d7916e
commit 651becbfb1

View file

@ -95,7 +95,7 @@ describe("normal behaviour", () => {
const typedArray = new T([1n, 2n, 3n]);
typedArray.forEach((value, index) => {
expect(value).toBe(typedArray[index]);
expect(index).toBe(parseInt(typedArray[index] - 1n));
expect(index).toBe(Number(typedArray[index] - 1n));
});
});
});