MCPcopy
hub / github.com/Effect-TS/effect / assertDraft2020_12

Function assertDraft2020_12

packages/effect/test/Schema/JSONSchema.new.test.ts:84–100  ·  view source on GitHub ↗
(
  schema: S,
  expected: object
)

Source from the content-addressed store, hash-verified

82}
83
84async function assertDraft2020_12<S extends Schema.Schema.All>(
85 schema: S,
86 expected: object
87) {
88 const definitions = {}
89 const jsonSchema = JSONSchema.fromAST(schema.ast, {
90 definitions,
91 target: "jsonSchema2020-12"
92 })
93 deepStrictEqual(jsonSchema, expected)
94 const valid = ajv2020.validateSchema(jsonSchema)
95 if (valid instanceof Promise) {
96 await valid
97 }
98 strictEqual(ajv2020.errors, null)
99 return jsonSchema
100}
101
102function assertAjvDraft7Success<S extends Schema.Schema.Any>(
103 schema: S,

Callers 1

Calls 2

deepStrictEqualFunction · 0.90
strictEqualFunction · 0.90

Tested by

no test coverage detected