# test.build/configuration/strings/diagram.strings.test.ts

> 34 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-configuration-strings-diagram-strings-test-ts
Source text: https://banes-lab.com/source/testing/test.build/configuration/strings/diagram.strings.test.ts.txt

Listed in [test.build/configuration/strings](https://banes-lab.com/api/source/testing/test.build/configuration/strings.md), after [test.build/configuration/strings/definition.strings.test.ts](https://banes-lab.com/source/testing/test.build/configuration/strings/definition.strings.test.ts.md) and before [test.build/configuration/strings/element.strings.test.ts](https://banes-lab.com/source/testing/test.build/configuration/strings/element.strings.test.ts.md).

## Contained in

- [test.build/configuration/strings](https://banes-lab.com/anatomy/testing/folder-testing-test-build-configuration-strings.md)

## Source

```typescript
import {
    NO_BROWSER,
    NO_STAGE_PORT,
    STAGE_NOT_READY,
    diagramFailed,
    diagramRelaunch,
    diagramStalled,
    diagramsLine,
    noEndpoint,
    noMarkup,
    stageThrew,
    undeclaredToken,
} from "@banes-lab/build-scripts/configuration/strings/diagram.strings.ts";
import { describe, expect, it } from "vitest";

describe("noEndpoint and diagramsLine", () => {
    it("name the browser state when no endpoint was written, and the count and folder of a render", () => {
        expect(noEndpoint("chrome", "profile", null)).toContain("the browser was still running");
        expect(noEndpoint("chrome", "profile", 1)).toContain("had exited with code 1");
        expect(diagramsLine(2, "diagrams")).toBe("diagrams: rendered 2 diagram(s) into diagrams\n");
    });
});

describe("the diagram render errors", () => {
    it("name the diagram, the token or the stage state each failure is about", () => {
        expect([STAGE_NOT_READY, NO_BROWSER, NO_STAGE_PORT].every((text) => text.startsWith("diagram"))).toBe(true);
        expect(stageThrew("boom")).toBe("diagram: the stage threw: boom");
        expect(diagramFailed(3, "flowchart TD", "boom")).toBe("diagram 3 (flowchart TD): boom");
        expect(noMarkup(3)).toContain("no markup for diagram 3");
        expect(diagramStalled(3, "flowchart TD", 3)).toContain(
            "diagram 3 (flowchart TD): the browser stopped answering",
        );
        expect(diagramRelaunch(3, "no reply")).toContain("relaunching it to resume there");
        expect(undeclaredToken("--ink")).toContain("the token --ink is not declared");
    });
});
```
