( schema: S, expected: object )
| 82 | } |
| 83 | |
| 84 | async 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 | |
| 102 | function assertAjvDraft7Success<S extends Schema.Schema.Any>( |
| 103 | schema: S, |
no test coverage detected