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

> 11 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-formatters-ontology-formatter-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/formatters/ontology.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/metric.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/metric.formatter.test.ts.md) and before [test.build/core/formatters/page.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/page.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 { createGovlabContext } from "@govlab/context";
import { renderSnapshot } from "@banes-lab/build-scripts/core/formatters/ontology.formatter.ts";
import { snapshotOf } from "@banes-lab/build-scripts/core/converters/ontology.converter.ts";

describe("renderSnapshot", () => {
    it("emits a typed data module carrying the snapshot", () => {
        const module = renderSnapshot(snapshotOf(createGovlabContext()));
        expect(module.startsWith('import type { OntologySnapshot } from "#types/ontology.types";')).toBe(true);
        expect(module).toContain("export const ONTOLOGY: OntologySnapshot = JSON.parse(");
    });
});
```
