chore: Merge conflicts with master
This commit is contained in:
@@ -13,25 +13,33 @@ class MockRepo {
|
||||
findAndCount,
|
||||
del,
|
||||
count,
|
||||
insertBulk,
|
||||
}) {
|
||||
this.create_ = create;
|
||||
this.update_ = update;
|
||||
this.remove_ = remove;
|
||||
this.delete_ = del;
|
||||
this.softRemove_ = softRemove;
|
||||
this.find_ = find;
|
||||
this.findDescendantsTree_ = findDescendantsTree;
|
||||
this.findOne_ = findOne;
|
||||
this.findOneOrFail_ = findOneOrFail;
|
||||
this.save_ = save;
|
||||
this.findAndCount_ = findAndCount;
|
||||
this.findOneWithRelations_ = findOneWithRelations;
|
||||
this.create_ = create
|
||||
this.update_ = update
|
||||
this.remove_ = remove
|
||||
this.delete_ = del
|
||||
this.softRemove_ = softRemove
|
||||
this.find_ = find
|
||||
this.findDescendantsTree_ = findDescendantsTree
|
||||
this.findOne_ = findOne
|
||||
this.findOneOrFail_ = findOneOrFail
|
||||
this.save_ = save
|
||||
this.findAndCount_ = findAndCount
|
||||
this.findOneWithRelations_ = findOneWithRelations
|
||||
this.insertBulk_ = insertBulk
|
||||
}
|
||||
|
||||
setFindOne(fn) {
|
||||
this.findOne_ = fn
|
||||
}
|
||||
|
||||
insertBulk = jest.fn().mockImplementation((...args) => {
|
||||
if (this.insertBulk_) {
|
||||
return this.insertBulk_(...args)
|
||||
}
|
||||
return {}
|
||||
})
|
||||
create = jest.fn().mockImplementation((...args) => {
|
||||
if (this.create_) {
|
||||
return this.create_(...args)
|
||||
@@ -69,15 +77,10 @@ class MockRepo {
|
||||
if (this.findOne_) {
|
||||
return this.findOne_(...args)
|
||||
}
|
||||
});
|
||||
})
|
||||
findDescendantsTree = jest.fn().mockImplementation((...args) => {
|
||||
if (this.findDescendantsTree_) {
|
||||
return this.findDescendantsTree_(...args);
|
||||
}
|
||||
});
|
||||
findOneOrFail = jest.fn().mockImplementation((...args) => {
|
||||
if (this.findOneOrFail_) {
|
||||
return this.findOneOrFail_(...args)
|
||||
return this.findDescendantsTree_(...args)
|
||||
}
|
||||
})
|
||||
find = jest.fn().mockImplementation((...args) => {
|
||||
@@ -85,11 +88,6 @@ class MockRepo {
|
||||
return this.find_(...args)
|
||||
}
|
||||
})
|
||||
softRemove = jest.fn().mockImplementation((...args) => {
|
||||
if (this.softRemove_) {
|
||||
return this.softRemove_(...args)
|
||||
}
|
||||
})
|
||||
save = jest.fn().mockImplementation((...args) => {
|
||||
if (this.save_) {
|
||||
return this.save_(...args)
|
||||
|
||||
Reference in New Issue
Block a user