MCPcopy
hub / github.com/ajv-validator/ajv / testOptionMeta

Function testOptionMeta

spec/options/meta_validateSchema.spec.ts:10–20  ·  view source on GitHub ↗
(ajv)

Source from the content-addressed store, hash-verified

8 testOptionMeta(new _Ajv({meta: true}))
9
10 function testOptionMeta(ajv) {
11 ajv.getSchema("http://json-schema.org/draft-07/schema").should.be.a("function")
12 ajv.validateSchema({$id: "ok", type: "integer"}).should.equal(true)
13 ajv.validateSchema({$id: "wrong", type: 123}).should.equal(false)
14 should.not.throw(() => {
15 ajv.addSchema({$id: "ok", type: "integer"})
16 })
17 should.throw(() => {
18 ajv.addSchema({$id: "wrong", type: 123})
19 }, /schema is invalid/)
20 }
21 })
22
23 it("should throw if meta: false and validateSchema: true", () => {

Callers 1

Calls 4

validateSchemaMethod · 0.80
throwMethod · 0.80
getSchemaMethod · 0.45
addSchemaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…