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:
co-authored by
Oli Juhl
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent
8772a0722e
commit
a52d5ed786
@@ -29,6 +29,7 @@ class MockRepo {
|
|||||||
this.findAndCount_ = findAndCount
|
this.findAndCount_ = findAndCount
|
||||||
this.findOneWithRelations_ = findOneWithRelations
|
this.findOneWithRelations_ = findOneWithRelations
|
||||||
this.insertBulk_ = insertBulk
|
this.insertBulk_ = insertBulk
|
||||||
|
this.count_ = count
|
||||||
|
|
||||||
this.metadata = metadata ?? {
|
this.metadata = metadata ?? {
|
||||||
columns: [],
|
columns: [],
|
||||||
@@ -108,7 +109,7 @@ class MockRepo {
|
|||||||
})
|
})
|
||||||
count = jest.fn().mockImplementation((...args) => {
|
count = jest.fn().mockImplementation((...args) => {
|
||||||
if (this.count_) {
|
if (this.count_) {
|
||||||
return this.count(...args)
|
return this.count_(...args)
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user