Files
lunarfront-app/packages/backend/__tests__/routes/v1/health.test.ts
Ryan Moon 01d6ff3fa3 Move tests to __tests__ folders, add unit tests for shared utils and services
Restructure tests into __tests__/ directories at package root so they can
be excluded from production builds. Add unit tests for dates, currency,
lookup service, payment method default logic, and tax exemption state
transitions.
2026-03-27 21:14:42 -05:00

31 lines
756 B
TypeScript

import { describe, it, expect, beforeAll, afterAll } from 'bun:test'
import type { FastifyInstance } from 'fastify'
import { createTestApp } from '../../../src/test/helpers.js'
describe('GET /v1/health', () => {
let app: FastifyInstance
beforeAll(async () => {
app = await createTestApp()
})
afterAll(async () => {
await app.close()
})
it('returns ok when db and redis are connected', async () => {
const response = await app.inject({
method: 'GET',
url: '/v1/health',
})
expect(response.statusCode).toBe(200)
const body = response.json()
expect(body.status).toBe('ok')
expect(body.db).toBe('connected')
expect(body.redis).toBe('connected')
expect(body.timestamp).toBeDefined()
})
})