You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing out that emails send correctly, we should verify that the ejs parses the given data correctly. Rather than doing when(emailService.sendOrderConfirmation(member.email, member.firstName, anything())).thenResolve();, we should actually call the function, and only mock this.sendEmail(data);. This will ensure that in the event an error is thrown (e.g. log.warn('Failed to send order confirmation email to ${email}', { error });), then the tests will catch this error. Otherwise, we're relying on the assumption that the .ejs templates will pass.
The text was updated successfully, but these errors were encountered:
When testing out that emails send correctly, we should verify that the ejs parses the given data correctly. Rather than doing
when(emailService.sendOrderConfirmation(member.email, member.firstName, anything())).thenResolve();
, we should actually call the function, and only mockthis.sendEmail(data);
. This will ensure that in the event an error is thrown (e.g.log.warn('Failed to send order confirmation email to ${email}', { error });
), then the tests will catch this error. Otherwise, we're relying on the assumption that the.ejs
templates will pass.The text was updated successfully, but these errors were encountered: