# tests/core/generators/fixture.generator.test.ts

> 16 lines of code and 0 definitions.

Tree: Coordination tree
Language: typescript
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tests-core-generators-fixture-generator-test-ts
Source text: https://banes-lab.com/assets/sources/source.4bbbe222cc8f9c27ca9cb23cf452e79974da6705a63f0b5bff088117216bb43e.generated.txt

## Source

```typescript
import { describe, it } from "node:test";
import { existsSync, readFileSync } from "node:fs";
import assert from "node:assert/strict";
import { growFixtureTree } from "../../../tools/core/generators/fixture.generator.ts";
import { join } from "node:path";

describe("growFixtureTree", () => {
    it("writes each sample at its path under a fresh root, and removes the root on release", () => {
        const tree = growFixtureTree([
            { path: "a.md", text: "alpha" },
            { path: "nested/b.md", text: "beta" },
        ]);
        assert.equal(readFileSync(join(tree.root, "nested", "b.md"), "utf8"), "beta");
        tree.release();
        assert.equal(existsSync(tree.root), false);
    });
});
```
