(_request, reply)
| 249 | }) |
| 250 | |
| 251 | const httpHeaderHandler: RouteHandlerMethod = function (_request, reply) { |
| 252 | // accept is a header provided by @types/node |
| 253 | reply.getHeader('accept') |
| 254 | expect(reply.getHeaders()).type.toHaveProperty('accept') |
| 255 | reply.hasHeader('accept') |
| 256 | reply.header('accept', 'test') |
| 257 | reply.headers({ accept: 'test' }) |
| 258 | reply.removeHeader('accept') |
| 259 | |
| 260 | // x-fastify-test is not a header provided by @types/node |
| 261 | // and should not result in a typing error |
| 262 | reply.getHeader('x-fastify-test') |
| 263 | expect(reply.getHeaders()).type.toHaveProperty('x-fastify-test') |
| 264 | reply.hasHeader('x-fastify-test') |
| 265 | reply.header('x-fastify-test', 'test') |
| 266 | reply.headers({ 'x-fastify-test': 'test' }) |
| 267 | reply.removeHeader('x-fastify-test') |
| 268 | } |
| 269 | |
| 270 | // Test: send() without arguments is valid when no Reply type is specified (default unknown) |
| 271 | server.get('/get-no-type-send-empty', async function handler (request, reply) { |
nothing calls this directly
no test coverage detected