({ schema, method, url, httpPart })
| 12 | const ajv = new Ajv({ coerceTypes: true }) |
| 13 | |
| 14 | function schemaValidator ({ schema, method, url, httpPart }) { |
| 15 | const validateFunction = ajv.compile(schema) |
| 16 | const fn = function (body) { |
| 17 | const isOk = validateFunction(body) |
| 18 | if (isOk) return |
| 19 | return false |
| 20 | } |
| 21 | fn.errors = [] |
| 22 | return fn |
| 23 | } |
| 24 | |
| 25 | test('handleRequest function - sent reply', t => { |
| 26 | t.plan(1) |
nothing calls this directly
no outgoing calls
no test coverage detected