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

> 16 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-formatters-route-formatter-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/formatters/route.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/reference.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/reference.formatter.test.ts.md) and before [test.build/core/formatters/search.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/search.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 { renderNumbers, renderRoute } from "@banes-lab/build-scripts/core/formatters/route.formatter.ts";
import { LINK } from "./link.fixture.ts";

describe("renderRoute", () => {
    it("numbers each stop and names its block", () => {
        expect(renderRoute("Route", [{ block: "Start", link: LINK, position: 1, requires: [] }])).toContain(
            "1. [A](https://x.test/a.md) (Start)",
        );
    });
});

describe("renderNumbers", () => {
    it("lists each number before its link under the title", () => {
        const row = { kind: "section", link: LINK, number: "M.1", part: null };
        expect(renderNumbers("Numbers", [row])).toContain("- M.1 [A](https://x.test/a.md)");
    });
});
```
