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:
adil
2023-09-18 15:26:13 +02:00
committed by GitHub
parent 8772a0722e
commit a52d5ed786

View File

@@ -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 {}
})