import { describe, it, expect } from 'vitest';
import { buildApp } from '../src/app';

describe('Server', () => {
  it('GET /api/health devuelve 200 y { status: "ok" }', async () => {
    const app = buildApp();
    await app.ready();

    const res = await app.inject({ method: 'GET', url: '/api/health' });
    expect(res.statusCode).toBe(200);
    expect(res.json()).toEqual({ status: 'ok' });

    await app.close();
  });
});

/**
 * Metadatos:
 * Autor: GitHub Copilot
 * Última actualización: 2026-02-07
 */
