fix: resolve test infrastructure issues
- Fixed server.js to only start when run directly (not when imported by tests) - Updated CouchDB service mocks in errorhandling and gamification tests - Added proper mock implementations for createDocument and updateDocument - All 221 model tests now passing with standardized error handling 🤖 Generated with [AI Assistant] Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
This commit is contained in:
@@ -5,8 +5,14 @@ jest.mock('../services/couchdbService', () => ({
|
||||
create: jest.fn(),
|
||||
getById: jest.fn(),
|
||||
find: jest.fn(),
|
||||
createDocument: jest.fn(),
|
||||
updateDocument: jest.fn(),
|
||||
createDocument: jest.fn().mockImplementation((doc) => ({
|
||||
...doc,
|
||||
_rev: '1-abc123'
|
||||
})),
|
||||
updateDocument: jest.fn().mockImplementation((doc) => ({
|
||||
...doc,
|
||||
_rev: '2-def456'
|
||||
})),
|
||||
deleteDocument: jest.fn(),
|
||||
findByType: jest.fn().mockResolvedValue([]),
|
||||
findUserById: jest.fn(),
|
||||
|
||||
Reference in New Issue
Block a user