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

LibJS/Tests: Test splice at non zero index

This commit is contained in:
Florian Stellbrink 2023-07-16 17:08:07 +02:00 committed by Linus Groh
parent 60750d864e
commit d4d7550588

View file

@ -46,6 +46,11 @@ test("basic functionality", () => {
removed = array.splice(-123, 123);
expect(array).toEqual([]);
expect(removed).toEqual(["foo", "bar", "baz"]);
array = ["foo", "bar"];
removed = array.splice(1, 1, "baz");
expect(array).toEqual(["foo", "baz"]);
expect(removed).toEqual(["bar"]);
});
test("Invalid lengths", () => {