Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("setAt", () => {
const ar = new TypedArray([1, 2]);
expect(ar[FixedSizeIndexedCollection.setAt](0, 3)).toBe(true);
expect(ar).toEqual(new TypedArray([3, 2]));
expect(ar[FixedSizeIndexedCollection.setAt](2, 4)).toBe(false);
expect(ar).toEqual(new TypedArray([3, 2]));
});
});
it("setAt", () => {
const obj = ["a", "b"];
expect(obj[FixedSizeIndexedCollection.setAt](0, "c")).toBe(true);
expect(obj).toEqual(["c", "b"]);
expect(obj[FixedSizeIndexedCollection.setAt](2, "d")).toBe(true);
expect(obj).toEqual(["c", "b", "d"]);
});
});