# tests/core/readers/board.reader.test.ts

> 24 lines of code and 0 definitions.

Tree: Coordination tree
Language: typescript
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tests-core-readers-board-reader-test-ts
Source text: https://banes-lab.com/assets/sources/source.3a8705384cf109d7833be0f66f1b63adf35c029570fb57f0ca2476a6689febff.generated.txt

## Source

```typescript
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { readBoardContract } from "../../../tools/core/readers/board.reader.ts";

describe("readBoardContract", () => {
    it("reads the placeholder fields under the first agent and gate anchors, stopping at the first other line", () => {
        const template = [
            "Agent <letter> — <STATE>",
            "  Owns: <paths>",
            "  Flags: —",
            "  Note: filled in",
            "  Refs: <refs>",
            "",
            "Gate <id> — <state>",
            "  State: <v>",
            "",
            "Agent <second> — <STATE>",
            "  Extra: <v>",
        ].join("\n");
        assert.deepEqual(readBoardContract(template), { agentFields: ["Owns", "Flags"], gateFields: ["State"] });
    });

    it("reads nothing from a template that declares no record", () => {
        assert.deepEqual(readBoardContract("prose"), { agentFields: [], gateFields: [] });
    });
});
```
