Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Add DI for MailClient #395

Closed
Tracked by #849
seaerchin opened this issue Mar 17, 2022 · 0 comments · Fixed by #419
Closed
Tracked by #849

[REF] Add DI for MailClient #395

seaerchin opened this issue Mar 17, 2022 · 0 comments · Fixed by #419
Assignees

Comments

@seaerchin
Copy link
Contributor

seaerchin commented Mar 17, 2022

Problem

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant