the beginning of the idiots

This commit is contained in:
2025-10-24 14:51:13 -05:00
parent 0b377030c6
commit cb06217ef7
123 changed files with 10279 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// tests/app.test.js
const request = require('supertest');
const app = require('../index');
describe('Main Application Routes', () => {
test('GET / should return welcome message', async () => {
const response = await request(app)
.get('/')
.expect(200);
expect(response.body).toHaveProperty('message');
expect(response.body.message).toBe('Welcome to MerchantsOfHope.org - TSYS Group Recruiting Platform');
expect(response.body).toHaveProperty('status');
expect(response.body.status).toBe('running');
});
test('GET /health should return health status', async () => {
const response = await request(app)
.get('/health')
.expect(200);
expect(response.body).toHaveProperty('status');
expect(response.body.status).toBe('OK');
expect(response.body).toHaveProperty('service');
expect(response.body.service).toBe('MOH Portal API');
});
test('GET /nonexistent should return 404', async () => {
const response = await request(app)
.get('/nonexistent')
.expect(404);
expect(response.body).toHaveProperty('error');
expect(response.body.error).toBe('Route not found');
});
});