Open dina75 opened 1 year ago
I am not able to reproduce 🤔
Node Version: v18.16.0 fastify: "^4.22.2" "fastify-custom-healthcheck": "^3.1.0"
// Require the framework and instantiate it
const fastify = require('fastify')({ logger: true })
const customHealthCheck = require('fastify-custom-healthCheck');
fastify
.register(customHealthCheck, {
path: "/health/check",
info: { message: 'HealthCheck' },
exposeFailure: true
})
.then(() => {
fastify.addHealthCheck('sync', () => true)
})
fastify.ready().then(() => {
console.log("everything ready")
}).then(() => {
// Run the server!
fastify.listen({ port: 3000 }, (err) => {
if (err) {
fastify.log.error(err)
process.exit(1)
}
})
})
I have added fastify-custom-healthcheck for extending health functionalities of my app. but when i run my unit or integration tests it was failing at the time of hitting app.ready() and didn't even throw any valid errors other than 'Exceeded timeout of 5000 ms for a hook'. When i run without 'fastify-custom-healthcheck', it works fine. I will appreciate your help, if anyone can
**Code snippet***** fastify .register(customHealthCheck, { path:
${routePrefix}/health/check
, info: { message: 'HealthCheck' }, exposeFailure: true }) .then(() => { astify.addHealthCheck('sync', () => true) })