fix: adds tests
This commit is contained in:
1 parent
fa1fe9d619
commit
69442a1735
6 files changed
+229
-2240
No files matched your search
@@ -1,4 +1,8 @@
|
||||
export default {
|
||||
getRepository: function (repo) {
|
||||
return repo;
|
||||
},
|
||||
|
||||
getCustomRepository: function (repo) {
|
||||
return repo;
|
||||
},
|
||||
|
||||
@@ -10,10 +10,12 @@ class MockRepo {
|
||||
findOneOrFail,
|
||||
save,
|
||||
findAndCount,
|
||||
del,
|
||||
}) {
|
||||
this.create_ = create;
|
||||
this.update_ = update;
|
||||
this.remove_ = remove;
|
||||
this.delete_ = del;
|
||||
this.softRemove_ = softRemove;
|
||||
this.find_ = find;
|
||||
this.findOne_ = findOne;
|
||||
@@ -93,6 +95,12 @@ class MockRepo {
|
||||
}
|
||||
return {};
|
||||
});
|
||||
delete = jest.fn().mockImplementation((...args) => {
|
||||
if (this.delete_) {
|
||||
return this.delete_(...args);
|
||||
}
|
||||
return {};
|
||||
});
|
||||
}
|
||||
|
||||
export default (methods = {}) => {
|
||||
|
||||
Reference in new issue
Block a user