test.govlab/constants/core/lexers/identifier.lexer.test.ts

test.govlab/constants/core/lexers/identifier.lexer.test.ts is a file in Codebase Testing. 12 lines of code and 0 definitions.

import { expect, test } from "vitest";
import { identifierParts } from "@govlab/constants";

test("identifierParts splits a camel or pascal identifier at each lower-to-upper boundary", () => {
    expect(identifierParts("questionCoverageView")).toStrictEqual(["question", "Coverage", "View"]);
    expect(identifierParts("CreateLinker")).toStrictEqual(["Create", "Linker"]);
});

test("identifierParts keeps an acronym, a digit run and a plain word whole", () => {
    expect(identifierParts("SRP")).toStrictEqual(["SRP"]);
    expect(identifierParts("utf8Decoder")).toStrictEqual(["utf8Decoder"]);
    expect(identifierParts("registry")).toStrictEqual(["registry"]);
    expect(identifierParts("")).toStrictEqual([]);
});