# test.coordination/core/reporters/board.reporter.test.ts

> 31 lines of code and 0 definitions.

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

Listed in [test.coordination/core/reporters](https://banes-lab.com/api/source/testing/test.coordination/core/reporters.md), before [test.coordination/core/reporters/claim.reporter.test.ts](https://banes-lab.com/source/testing/test.coordination/core/reporters/claim.reporter.test.ts.md).

## Contained in

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

## Source

```typescript
import {
    changedSince,
    firstSnapshot,
    surfaceUnchanged,
} from "coordination-surface/tools/core/strings/board.strings.ts";
import { describe, it } from "vitest";
import { mkdtempSync, rmSync } from "node:fs";
import assert from "node:assert/strict";
import { changesSince } from "coordination-surface/tools/core/reporters/board.reporter.ts";
import { join } from "node:path";
import { tmpdir } from "node:os";
import { writeVerbatim } from "@govlab/canonical-write";

const TARGET = "board.txt";

describe("changesSince", () => {
    it("takes a first snapshot, then hands a seat nothing for an unchanged surface and the changed lines after a write", () => {
        const root = mkdtempSync(join(tmpdir(), "coordination-changes-"));
        try {
            const absolute = join(root, TARGET);
            assert.equal(changesSince(root, absolute, "A", TARGET), "");
            writeVerbatim(absolute, "# Board\nfirst line\n");
            assert.equal(changesSince(root, absolute, "A", TARGET), firstSnapshot("A"));
            assert.equal(changesSince(root, absolute, "A", TARGET), surfaceUnchanged(TARGET, "A"));
            writeVerbatim(absolute, "# Board\nfirst line\nan owner entry\n");
            const delivered = changesSince(root, absolute, "A", TARGET);
            assert.ok(delivered.startsWith(changedSince("A", 1)));
            assert.ok(delivered.includes("an owner entry"));
        } finally {
            rmSync(root, { force: true, recursive: true });
        }
    });
});
```
