# test.coordination/core/analyzers/checklist.analyzer.test.ts

> 26 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-coordination-core-analyzers-checklist-analyzer-test-ts
Source text: https://banes-lab.com/source/testing/test.coordination/core/analyzers/checklist.analyzer.test.ts.txt

Listed in [test.coordination/core/analyzers](https://banes-lab.com/api/source/testing/test.coordination/core/analyzers.md), after [test.coordination/core/analyzers/board.analyzer.test.ts](https://banes-lab.com/source/testing/test.coordination/core/analyzers/board.analyzer.test.ts.md) and before [test.coordination/core/analyzers/converge.analyzer.test.ts](https://banes-lab.com/source/testing/test.coordination/core/analyzers/converge.analyzer.test.ts.md).

## Contained in

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

## Source

```typescript
import { MILESTONE_MARKER, PHASE_MARKER } from "coordination-surface/tools/core/constants/checklist.constants.ts";
import { describe, it } from "vitest";
import assert from "node:assert/strict";
import { phaseSpans } from "coordination-surface/tools/core/analyzers/checklist.analyzer.ts";

describe("phaseSpans", () => {
    it("reads each phase with its title, start line, body and the band above it, and resets at a milestone", () => {
        const lines = [
            "band line",
            `${PHASE_MARKER}one`,
            "first body",
            `${PHASE_MARKER}two`,
            "second body",
            `${MILESTONE_MARKER}1`,
            "new band",
            `${PHASE_MARKER}three`,
        ];
        assert.deepEqual(phaseSpans(lines), [
            { band: "band line", line: 2, text: "first body", title: "one" },
            { band: "band line", line: 4, text: "second body", title: "two" },
            { band: "new band", line: 8, text: "", title: "three" },
        ]);
    });

    it("returns no span for lines that open no phase", () => {
        assert.deepEqual(phaseSpans(["just prose", "more prose"]), []);
    });
});
```
