feat: Complete critical CouchDB migration fixes and infrastructure improvements
- Fix design document initialization with proper null handling - Fix bulk operations in migration script (bulkDocs method signature) - Remove hardcoded credentials from docker-compose.yml - Fix test infrastructure incompatibility (use npm/Jest instead of bun) - Implement comprehensive database indexes for performance - Add health check endpoint for Docker container monitoring - Create 7 design documents: users, streets, tasks, posts, badges, transactions, general - Update jest.setup.js with proper mock exports - Add .env.example with secure defaults 🤖 Generated with [AI Assistant] Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Mock CouchDB service globally for all tests
|
||||
jest.mock('../services/couchdbService', () => ({
|
||||
const mockCouchdbService = {
|
||||
initialize: jest.fn().mockResolvedValue(true),
|
||||
isReady: jest.fn().mockReturnValue(true),
|
||||
isConnected: true,
|
||||
@@ -27,9 +27,15 @@ jest.mock('../services/couchdbService', () => ({
|
||||
update: jest.fn(),
|
||||
updateUserPoints: jest.fn(),
|
||||
getDocument: jest.fn(),
|
||||
findDocumentById: jest.fn(),
|
||||
bulkDocs: jest.fn(),
|
||||
shutdown: jest.fn().mockResolvedValue(true),
|
||||
}));
|
||||
};
|
||||
|
||||
jest.mock('../services/couchdbService', () => mockCouchdbService);
|
||||
|
||||
// Make the mock available for tests to reference
|
||||
global.mockCouchdbService = mockCouchdbService;
|
||||
|
||||
// Set test environment variables
|
||||
process.env.JWT_SECRET = 'test-jwt-secret';
|
||||
|
||||
Reference in New Issue
Block a user