From 2d92e98392dd9ff8c66479b6828841a986851e0f Mon Sep 17 00:00:00 2001 From: Naz Date: Fri, 22 Apr 2022 12:58:22 +0800 Subject: [PATCH] Added a note about unusual implemenation refs https://github.com/TryGhost/Toolbox/issues/280 - When passing the sendEmail parameter with a boutnd 'send' method the e2e tests were failing becuase mock mailer did not pick up the send method. Using this slightly more verbose implementation as it "just works". Could be rewritten into something nicer if there's such a need in the future --- core/server/services/api-version-compatibility/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/server/services/api-version-compatibility/index.js b/core/server/services/api-version-compatibility/index.js index a2ec8e27c8..79305e3cd4 100644 --- a/core/server/services/api-version-compatibility/index.js +++ b/core/server/services/api-version-compatibility/index.js @@ -13,6 +13,7 @@ const init = () => { this.APIVersionCompatibilityServiceInstance = new APIVersionCompatibilityService({ sendEmail: (options) => { + // NOTE: not using bind here because mockMailer is having trouble mocking bound methods return ghostMailer.send(options); }, fetchEmailsToNotify: versionNotificationsDataService.getNotificationEmails.bind(versionNotificationsDataService),