UNPKG

@paima/schema2typebox

Version:

Creates typebox code from JSON schemas

21 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const node_fs_1 = require("node:fs"); const node_test_1 = require("node:test"); const index_1 = require("../../src/index"); const test_utils_1 = require("../test-utils"); (0, node_test_1.describe)("integration tests - testing against real world schemas", () => { (0, node_test_1.test)("schema.org - dayOfWeek", async () => { const inputSchema = (0, node_fs_1.readFileSync)((0, test_utils_1.buildOsIndependentPath)([ process.cwd(), ..."test/integration/schemas/dayOfWeek.json".split("/"), ]), "utf-8"); const result = await (0, index_1.schema2typebox)({ input: inputSchema }); const expectedResult = (0, node_fs_1.readFileSync)((0, test_utils_1.buildOsIndependentPath)([ process.cwd(), ..."test/integration/schemas/dayOfWeek.ts".split("/"), ]), "utf-8"); await (0, test_utils_1.expectEqualIgnoreFormatting)(result, expectedResult); }); }); //# sourceMappingURL=integration.spec.js.map