import { expect, test } from "vitest";
import emptyThrows from "./emptyThrows";

const EXAMPLE_MESSAGE = "Array was empty";

test("throws on empty array", () => {
  expect(() => emptyThrows([], EXAMPLE_MESSAGE)).toThrow(EXAMPLE_MESSAGE);
});

test("returns array if not empty", () => {
  expect(emptyThrows(["content"], EXAMPLE_MESSAGE)).toEqual(["content"]);
});
