({
params,
body,
querystring,
headers,
response
})
| 1032 | } |
| 1033 | |
| 1034 | async function validate ({ |
| 1035 | params, |
| 1036 | body, |
| 1037 | querystring, |
| 1038 | headers, |
| 1039 | response |
| 1040 | }) { |
| 1041 | try { |
| 1042 | const res = await fastify.inject({ |
| 1043 | method: 'POST', |
| 1044 | url: `/${params}`, |
| 1045 | headers: { id: headers }, |
| 1046 | query: { id: querystring }, |
| 1047 | payload: { id: body } |
| 1048 | }) |
| 1049 | t.assert.strictEqual(res.statusCode, response) |
| 1050 | } catch (error) { |
| 1051 | t.assert.fail('should not throw') |
| 1052 | } |
| 1053 | } |
| 1054 | }) |
| 1055 | |
| 1056 | test('Check mixed sync and async AJV validations', async (t) => { |
no test coverage detected