/api/health has no route test

Open Beginner friendly
#830 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
nextjs, typescript
Domain
api, testing

Research direction

Read web/src/app/api/health/route.ts:5-12 and locate the project’s route test conventions. Add tests with a fake snapshotHealth() covering fresh and stale responses, including Cache-Control: no-store on both; use an exported cache reset or injected clock to control the 60-second cache. Done when all four response assertions pass.

Written by the indexing model from the issue text.

Description

night-shift web

From the 2026-11-06 web audit (W35). web/src/app/api/health/route.ts:5-12 has no test, and uptime monitoring depends on its 200/503 split. It caches the snapshot in module scope for 60 s.

Fix. Route test with a fake snapshotHealth(): fresh gives 200, stale gives 503, both Cache-Control: no-store. Export a resetHealthCache() for tests or inject Date.now. Size S.

Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CDVolvik/everloot

All issues in CDVolvik/everloot

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.