fix(medusa-test-utils): Fixed count serialization and incorrect function call (#5090)
- Serialized `count` - Updated the function name called inside the mock implementation Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -29,6 +29,7 @@ class MockRepo {
|
||||
this.findAndCount_ = findAndCount
|
||||
this.findOneWithRelations_ = findOneWithRelations
|
||||
this.insertBulk_ = insertBulk
|
||||
this.count_ = count
|
||||
|
||||
this.metadata = metadata ?? {
|
||||
columns: [],
|
||||
@@ -108,7 +109,7 @@ class MockRepo {
|
||||
})
|
||||
count = jest.fn().mockImplementation((...args) => {
|
||||
if (this.count_) {
|
||||
return this.count(...args)
|
||||
return this.count_(...args)
|
||||
}
|
||||
return {}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user