(schema, expectedLoadCallCount)
| 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)", () => { |
no test coverage detected
searching dependent graphs…