Files
plantillas-proyectos/frontend/src/lib/backend.test.ts
Kevin_Ramirez bdd089954b
Some checks failed
Build Producción & Push a Harbor / test (push) Failing after 3s
Build Producción & Push a Harbor / build (push) Has been skipped
Aduanasoft/plantillas-proyectos/pipeline/head There was a failure building this commit
feat: plantilla base workspace SaaS
2026-07-21 13:59:00 -05:00

21 lines
912 B
TypeScript

import { describe, it, expect } from 'vitest'
// Solo en entorno con DNS `backend` (p. ej. red Docker) y con backend levantado; en Jenkins/CI se omite.
const skipHttpIntegration = process.env.CI === 'true' || Boolean(process.env.JENKINS_URL)
describe.skipIf(skipHttpIntegration)('backend — health check', () => {
it('el backend esta corriendo y responde', async () => {
const response = await fetch('http://backend:8000/api/health')
expect(response.status).toBe(200)
})
it('el endpoint de facturas responde', async () => {
const response = await fetch('http://backend:8000/api/v1/a76/invoices/?company_id=1', {
headers: { 'Authorization': 'Bearer test' }
})
// 200 con datos o 401/403 sin token valido — ambos significan que el backend esta vivo
expect([200, 401, 403, 422]).toContain(response.status)
})
})