UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

18 lines (15 loc) 477 B
import { arrayCompact } from "./array-compact.js"; import { Test_setDefaultFlags } from "../../test-util/test_set-default-flags.js"; describe("=> arrayCompact", () => { beforeEach(() => { Test_setDefaultFlags(); }); const values = ["a", "b", null, undefined] as const; it("| returns an array minus null and undefined", () => { const result: ("a" | "b")[] = arrayCompact(values); expect(result).toEqual(["a", "b"]); }); });