# test.build/core/formatters/record.formatter.test.ts

> 25 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-formatters-record-formatter-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/formatters/record.formatter.test.ts.txt

Listed in [test.build/core/formatters](https://banes-lab.com/api/source/testing/test.build/core/formatters.md), after [test.build/core/formatters/page.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/page.formatter.test.ts.md) and before [test.build/core/formatters/reference.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/reference.formatter.test.ts.md).

## Contained in

- [test.build/core/formatters](https://banes-lab.com/anatomy/testing/folder-testing-test-build-core-formatters.md)

## Source

```typescript
import { describe, expect, it } from "vitest";
import { LINK } from "./link.fixture.ts";
import { renderRecordLeaf } from "@banes-lab/build-scripts/core/formatters/record.formatter.ts";

const PRINCIPLE = {
    formedBy: "A writer skips the owner.",
    href: null,
    kind: "anti-pattern",
    layer: null,
    name: "R",
    ref: "architecture:r",
    relations: [{ links: [LINK], relation: "refactored-by" }],
    severity: "mandatory",
    siblings: null,
    summary: null,
    up: null,
};

describe("renderRecordLeaf", () => {
    it("renders a record with how it forms, its severity and one section per relation, and no placement without an index", () => {
        const record = renderRecordLeaf(PRINCIPLE);
        expect(record).not.toContain("Listed in");
        expect(record).toContain("Formed by: A writer skips the owner.");
        expect(record).toContain("Severity: mandatory");
        expect(record).toContain("## Refactored by");
    });
});
```
