| 1 | import { assert, describe, it } from "@effect/vitest" |
| 2 | import { SchemaRepresentation } from "effect" |
| 3 | |
| 4 | describe("SchemaRepresentation.toMultiDocument", () => { |
| 5 | it("wraps the root representation and preserves references", () => { |
| 6 | const reference = { _tag: "String" as const, checks: [] } |
| 7 | assert.deepStrictEqual( |
| 8 | SchemaRepresentation.toMultiDocument({ |
| 9 | representation: { _tag: "Reference", $ref: "Value" }, |
| 10 | references: { Value: reference } |
| 11 | }), |
| 12 | { |
| 13 | representations: [{ _tag: "Reference", $ref: "Value" }], |
| 14 | references: { Value: reference } |
| 15 | } |
| 16 | ) |
| 17 | }) |
| 18 | }) |