From a52d5ed7863c31e29602a9f0c8edac35d151ad2c Mon Sep 17 00:00:00 2001 From: adil <68734155+adevinwild@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:26:13 +0200 Subject: [PATCH] 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> --- packages/medusa-test-utils/src/mock-repository.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/medusa-test-utils/src/mock-repository.js b/packages/medusa-test-utils/src/mock-repository.js index accefe207a..352ed387b6 100644 --- a/packages/medusa-test-utils/src/mock-repository.js +++ b/packages/medusa-test-utils/src/mock-repository.js @@ -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 {} })