schema2typebox
Version:
Creates typebox code from JSON schemas
21 lines • 994 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const globals_1 = require("@jest/globals");
const node_fs_1 = require("node:fs");
const index_1 = require("../src/index");
const util_1 = require("./util");
(0, globals_1.describe)("when testing against real world schemas", () => {
(0, globals_1.test)("works for schema.org - dayOfWeek", async () => {
const inputSchema = (0, node_fs_1.readFileSync)((0, util_1.buildOsIndependentPath)([
process.cwd(),
..."test/fixture/dayOfWeek.json".split("/"),
]), "utf-8");
const result = await (0, index_1.schema2typebox)({ input: inputSchema });
const expectedResult = (0, node_fs_1.readFileSync)((0, util_1.buildOsIndependentPath)([
process.cwd(),
..."test/fixture/dayOfWeek.ts".split("/"),
]), "utf-8");
await (0, util_1.expectEqualIgnoreFormatting)(result, expectedResult);
});
});
//# sourceMappingURL=schema.spec.js.map
;