Files
ruflo/v2/examples/05-swarm-apps/rest-api/tests/server.test.js
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

42 lines
1.3 KiB
JavaScript

const request = require('supertest');
const app = require('../src/server');
describe('Server Tests', () => {
describe('GET /health', () => {
it('should return health status', async () => {
const response = await request(app)
.get('/health')
.expect(200);
expect(response.body).toHaveProperty('status', 'healthy');
expect(response.body).toHaveProperty('timestamp');
expect(response.body).toHaveProperty('uptime');
expect(response.body).toHaveProperty('environment');
});
});
describe('GET /api/v1', () => {
it('should return API information', async () => {
const response = await request(app)
.get('/api/v1')
.expect(200);
expect(response.body).toHaveProperty('message', 'REST API Example');
expect(response.body).toHaveProperty('version', '1.0.0');
expect(response.body).toHaveProperty('endpoints');
expect(response.body.endpoints).toHaveProperty('users');
expect(response.body.endpoints).toHaveProperty('products');
});
});
describe('404 Handler', () => {
it('should return 404 for unknown routes', async () => {
const response = await request(app)
.get('/unknown-route')
.expect(404);
expect(response.body).toHaveProperty('error', 'Not Found');
expect(response.body).toHaveProperty('message');
});
});
});