UNPKG

hypertune

Version:

[Hypertune](https://www.hypertune.com/) is the most flexible platform for feature flags, A/B testing, analytics and app configuration. Built with full end-to-end type-safety, Git-style version control and local, synchronous, in-memory flag evaluation. Opt

13 lines (9 loc) 364 B
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"]); });