File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @vitest -environment node
3+ */
4+ import { describe , expect , it } from 'vitest'
5+ import { GET } from '@/app/api/health/route'
6+
7+ describe ( 'GET /api/health' , ( ) => {
8+ it ( 'returns an ok status payload' , async ( ) => {
9+ const response = await GET ( )
10+
11+ expect ( response . status ) . toBe ( 200 )
12+ await expect ( response . json ( ) ) . resolves . toEqual ( {
13+ status : 'ok' ,
14+ timestamp : expect . any ( String ) ,
15+ } )
16+ } )
17+ } )
Original file line number Diff line number Diff line change 1+ /**
2+ * Health check endpoint for deployment platforms and container probes.
3+ */
4+ export async function GET ( ) : Promise < Response > {
5+ return Response . json (
6+ {
7+ status : 'ok' ,
8+ timestamp : new Date ( ) . toISOString ( ) ,
9+ } ,
10+ { status : 200 }
11+ )
12+ }
You can’t perform that action at this time.
0 commit comments