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) • 491 B
text/typescript
import { mapKeysToArray } from "./map-keys-to-array.js";
import { Test_setDefaultFlags } from "../../test-util/test_set-default-flags.js";
describe("=> mapKeysToArray", () =>
{
beforeEach(() =>
{
Test_setDefaultFlags();
});
const values = new Map([["a", 1], ["b", 2], ["c", 3]] as const);
it("| returns the map's keys", () =>
{
const result: ("a" | "b" | "c")[] = mapKeysToArray(values);
expect(result).toEqual(["a", "b", "c"]);
});
});