array-simple-and-generic-storage-initialization.js 507 B

123456789101112131415
  1. describe("Issue #3382", () => {
  2. test("Creating an array with simple storage (<= 200 initial elements)", () => {
  3. var a = Array(200);
  4. expect(a).toHaveLength(200);
  5. expect(a.push("foo")).toBe(201);
  6. expect(a).toHaveLength(201);
  7. });
  8. test("Creating an array with generic storage (> 200 initial elements)", () => {
  9. var a = Array(201);
  10. expect(a).toHaveLength(201);
  11. expect(a.push("foo")).toBe(202);
  12. expect(a).toHaveLength(202);
  13. });
  14. });