# test.content/core/renderers/baseline.renderer.test.ts

> 38 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-content-core-renderers-baseline-renderer-test-ts
Source text: https://banes-lab.com/source/testing/test.content/core/renderers/baseline.renderer.test.ts.txt

Listed in [test.content/core/renderers](https://banes-lab.com/api/source/testing/test.content/core/renderers.md), before [test.content/core/renderers/chapter.renderer.test.ts](https://banes-lab.com/source/testing/test.content/core/renderers/chapter.renderer.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { GENERATED_MARK_PREFIX } from "@govlab/canonical-write";
import type { ToneBaseline } from "@banes-lab/content/types/tone.types.ts";
import { renderBaseline } from "@banes-lab/content/core/renderers/baseline.renderer.ts";

const BASELINE: ToneBaseline = {
    modules: [
        {
            agentlessPassives: 1,
            bannedTerms: 1,
            chainedSentences: 2,
            collectivePerson: 0,
            digitMetrics: 2,
            firstPerson: 3,
            labeledItems: 4,
            literals: 10,
            longDashes: 5,
            longestSentence: 12,
            module: "fixture.strings.ts",
            secondPerson: 6,
            semicolons: 7,
            sentences: 8,
            words: 40,
        },
    ],
};

describe("renderBaseline", () => {
    const rendered = renderBaseline(BASELINE);

    it("opens with frontmatter carrying the document's type, name, concern and status", () => {
        expect(rendered.startsWith("---\ntype: reference\nname: tone-baseline\n")).toBe(true);
        expect(rendered).toContain("concern: product\nstatus: current\n---");
    });

    it("carries one row per module with the mean words per sentence, and leaves the generated mark to the writer", () => {
        expect(rendered).not.toContain(GENERATED_MARK_PREFIX);
        expect(rendered).toContain(
            "| fixture.strings.ts | 10 | 8 | 5.0 | 12 | 1 | 2 | 5 | 7 | 2 | 1 | 3 | 6 | 0 | 4 |",
        );
    });
});
```
