(method)
| 22 | await Promise.all(supportedMethods.map(async method => injectRequest(method))) |
| 23 | |
| 24 | async function injectRequest (method) { |
| 25 | const options = { |
| 26 | url: '/', |
| 27 | method |
| 28 | } |
| 29 | |
| 30 | if (requirePayload.includes(method)) { |
| 31 | options.payload = { hello: 'world' } |
| 32 | } |
| 33 | |
| 34 | const res = await fastify.inject(options) |
| 35 | const payload = JSON.parse(res.payload) |
| 36 | t.assert.deepStrictEqual(payload, { method }) |
| 37 | } |
| 38 | }) |