import "./array";
import "./select";
import { Repeat } from "./repeat";

it("Generates a repeated array", () => {
  expect(Repeat(2, 5).array()).toEqual([2, 2, 2, 2, 2]);
});

it("Uses reference to repeat", () => {
  expect(
    Repeat({ test: 2 }, 5)
      .select((t) => {
        t.test += 1;
        return t;
      })
      .array()
  ).toEqual([{ test: 7 }, { test: 7 }, { test: 7 }, { test: 7 }, { test: 7 }]);
});
