EvalueTonSavoir/server/__mocks__/db.js

21 lines
452 B
JavaScript
Raw Normal View History

2024-10-01 11:30:26 -04:00
class MockDBConnection {
constructor() {
this.db = jest.fn().mockReturnThis();
this.collection = jest.fn().mockReturnThis();
this.insertOne = jest.fn();
this.findOne = jest.fn();
this.updateOne = jest.fn();
this.deleteOne = jest.fn();
}
async connect() {
// Simulate successful connection
}
getConnection() {
return this;
}
}
module.exports = MockDBConnection;