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

> 12 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-constants-core-lexers-identifier-lexer-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/constants/core/lexers/identifier.lexer.test.ts.txt

Listed in [test.govlab/constants/core/lexers](https://banes-lab.com/api/source/testing/test.govlab/constants/core/lexers.md).

## Contained in

- [test.govlab/constants/core/lexers](https://banes-lab.com/anatomy/testing/folder-testing-test-govlab-constants-core-lexers.md)

## Source

```typescript
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([]);
});
```
