mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
21 lines
452 B
JavaScript
21 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;
|