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
I am having some trouble mocking the service for my unit tests. It seems like, if I provide the SendGridModule in the imports it ignores the provider override and actually sends the email. If I do not provide the SendGridModule this is the error
Nest can't resolve dependencies of the MailerService (?, ConfigService). Please make sure that the argument SendGridToken at index [0] is available in the RootTestModule context.
Hey, you need to pass SENDGRID_TOKEN const from nestjs-sendgrid package in the provide property when creating your testing module. And just in case, pass the same value when getting the provider inside the beforeEach function
tl;dr -> The DI identifier/token for the SendGrid service is not the class, it's the constant SENDGRID_TOKEN
Hi, Great package.
I am having some trouble mocking the service for my unit tests. It seems like, if I provide the SendGridModule in the imports it ignores the provider override and actually sends the email. If I do not provide the SendGridModule this is the error
Nest can't resolve dependencies of the MailerService (?, ConfigService). Please make sure that the argument SendGridToken at index [0] is available in the RootTestModule context.
can you tell me where im going wrong?
Thanks
The text was updated successfully, but these errors were encountered: