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

Function test

spec/async.spec.ts:204–219  ·  view source on GitHub ↗
(schema, expectedLoadCallCount)

Source from the content-addressed store, hash-verified

202 })
203
204 function test(schema, expectedLoadCallCount) {
205 ajv.addKeyword({
206 keyword: "myFooBar",
207 type: "string",
208 validate: function (sch, data) {
209 return sch === data
210 },
211 })
212
213 return ajv.compileAsync(schema).then((validate) => {
214 should.equal(loadCallCount, expectedLoadCallCount)
215 validate.should.be.a("function")
216 validate("foo").should.equal(true)
217 validate("bar").should.equal(false)
218 })
219 }
220 })
221
222 it("should return compiled schema on the next tick if there are no references (#51)", () => {

Callers 1

async.spec.tsFile · 0.70

Calls 3

validateFunction · 0.85
compileAsyncMethod · 0.80
addKeywordMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…