Files
SYSTEM/test/unit/health.spec.ts

15 lines
328 B
TypeScript

import { expect, it, vi } from 'vitest';
vi.mock('~~/lib/prisma', () => ({
default: {
$queryRaw: vi.fn().mockResolvedValue([{ col: 1 }]),
},
}));
import handler from 'server/api/health.get';
it('returns db ok on successful query', async () => {
const res = await handler();
expect(res).toEqual({ db: 'ok' });
});