- Verify 500-character messages are accepted
- Verify messages exceeding 500 characters are rejected with HTTP 400
- Extract the Zod validation schema to module scope for reuse
- Test successful echo responses for valid messages
- Verify empty messages are rejected with HTTP 400
- Validate request bodies using a Zod schema with a 1–500 character limit
- Return a consistent error response for invalid request bodies
- Replace the placeholder test script with tsx --test
- Add tests for GET /health response status and payload
- Add tests for GET /ready response status and dependency status
- Use Fastify injection to test endpoints without opening a network listener
- Close the app after the test suite completes
- Extract route and server configuration into an exported buildApp function
- Guard server startup so importing the module does not automatically listen on port 3000
- Preserve health and readiness endpoints and loopback-only binding
- Normalize string literals to double quotes