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
In #369, the unit tests for MailClient was contorted using jest.resetCache to use a fresh copy of the env vars for testing. This is quite awkward and jarring, especially for engineers who do not know what resetCache does and why it's needed.
Solution
Rather than getting the key from the env var and using it directly, we should rewrite MailClient to use dependency injection and pass the POSTMAN_API_KEY as a parameter. This allows easier testing
The text was updated successfully, but these errors were encountered:
Problem
In #369, the unit tests for
MailClient
was contorted usingjest.resetCache
to use a fresh copy of the env vars for testing. This is quite awkward and jarring, especially for engineers who do not know whatresetCache
does and why it's needed.Solution
Rather than getting the key from the env var and using it directly, we should rewrite
MailClient
to use dependency injection and pass thePOSTMAN_API_KEY
as a parameter. This allows easier testingThe text was updated successfully, but these errors were encountered: