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

> 25 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-formatters-tree-formatter-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/formatters/tree.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/tab.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/tab.formatter.test.ts.md) and before [test.build/core/formatters/validation.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/validation.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 { relativePath } from "@ssot/paths";
import { renderTreeDeclarations } from "@banes-lab/build-scripts/core/formatters/tree.formatter.ts";

describe("renderTreeDeclarations", () => {
    it("writes the declarations as one typed module export", () => {
        const folder = relativePath("app.member");
        const text = renderTreeDeclarations([
            {
                exportName: "ANATOMY",
                exports: [],
                folder,
                generatedSources: false,
                label: "Site",
                license: null,
                packageName: "@banes-lab/web",
                repository: null,
                tab: "tree",
            },
        ]);
        expect(text.startsWith('import type { AnatomyTreeDeclaration } from "#types/anatomy.types";')).toBe(true);
        expect(text).toContain("export const ANATOMY_TREE_DECLARATIONS: readonly AnatomyTreeDeclaration[] = [");
        expect(text).toContain(`"folder": ${JSON.stringify(folder)}`);
        expect(text.endsWith(";\n")).toBe(true);
    });
});
```
