# test.govlab/context/core/normalizers/vocabulary.normalizer.test.ts

> 17 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-context-core-normalizers-vocabulary-normalizer-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/context/core/normalizers/vocabulary.normalizer.test.ts.txt

Listed in [test.govlab/context/core/normalizers](https://banes-lab.com/api/source/testing/test.govlab/context/core/normalizers.md), after [test.govlab/context/core/normalizers/reason.surface.normalizer.test.ts](https://banes-lab.com/source/testing/test.govlab/context/core/normalizers/reason.surface.normalizer.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { canonicalForceOf } from "@govlab/context/core/normalizers/vocabulary.normalizer.ts";
import { createGovlabContext } from "@govlab/context";

describe("canonicalForceOf", () => {
    it("names the canonical force a token folds to when it is spelled differently", () => {
        expect(canonicalForceOf("object creation")).toBe("object_creation");
        expect(canonicalForceOf("Object-Creation")).toBe("object_creation");
    });

    it("answers nothing for a canonical spelling, an anti-force or a free-form scope", () => {
        expect(canonicalForceOf("object_creation")).toBeNull();
        expect(canonicalForceOf("hardcoded-secrets (exposure)")).toBeNull();
        expect(canonicalForceOf("service")).toBeNull();
    });

    it("finds no misspelled force in the bundled canon", () => {
        expect(createGovlabContext().validateResolution().misspelledForces).toStrictEqual([]);
    });
});
```
