the-tip-top-backend/test/app.test.js
soufiane f9dd22909c fix: convert test to ES6 modules and export app
- Convert test/app.test.js from CommonJS to ES6 import/export
- Export app from index.js for testing
- Only start server if NODE_ENV !== 'test'
- Fixes 'require is not defined' error in tests
2025-11-18 16:53:46 +01:00

10 lines
253 B
JavaScript

import request from 'supertest';
import app from '../index.js';
describe('Test API health', () => {
it('GET /health doit répondre 200', async () => {
const res = await request(app).get('/health');
expect(res.statusCode).toBe(200);
});
});