EvalueTonSavoir/server/__mocks__/db.js

20 lines
452 B
JavaScript

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;