Files
ruflo/v2/examples/05-swarm-apps/rest-api-advanced/tests/setup.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

47 lines
1.1 KiB
JavaScript

// Test setup and configuration
const { MongoMemoryServer } = require('mongodb-memory-server');
const mongoose = require('mongoose');
let mongod;
// Setup before all tests
beforeAll(async () => {
// Create an in-memory MongoDB instance
mongod = await MongoMemoryServer.create();
const uri = mongod.getUri();
// Connect to the in-memory database
await mongoose.connect(uri, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
});
// Cleanup after each test
afterEach(async () => {
// Clear all collections
const collections = mongoose.connection.collections;
for (const key in collections) {
const collection = collections[key];
await collection.deleteMany({});
}
});
// Cleanup after all tests
afterAll(async () => {
// Disconnect and stop the in-memory MongoDB instance
await mongoose.connection.dropDatabase();
await mongoose.connection.close();
await mongod.stop();
});
// Global test timeout
jest.setTimeout(30000);
// Mock console methods in test environment
global.console = {
...console,
error: jest.fn(),
warn: jest.fn(),
log: jest.fn(),
};