0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

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
This commit is contained in:
Naz 2022-04-22 12:58:22 +08:00 committed by naz
parent 7b9a80fbf4
commit 2d92e98392

View file

@ -13,6 +13,7 @@ const init = () => {
this.APIVersionCompatibilityServiceInstance = new APIVersionCompatibilityService({ this.APIVersionCompatibilityServiceInstance = new APIVersionCompatibilityService({
sendEmail: (options) => { sendEmail: (options) => {
// NOTE: not using bind here because mockMailer is having trouble mocking bound methods
return ghostMailer.send(options); return ghostMailer.send(options);
}, },
fetchEmailsToNotify: versionNotificationsDataService.getNotificationEmails.bind(versionNotificationsDataService), fetchEmailsToNotify: versionNotificationsDataService.getNotificationEmails.bind(versionNotificationsDataService),