-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Summary
The mailer library recently added a 'disabled' mode that activates when SMTP configuration is missing in production. This mode needs test coverage.
Changes requiring test updates
Breaking change in createMailerFromEnv
- Old behavior: Threw an error when SMTP config missing in production
- New behavior: Returns
'disabled'mode with a warning
Tests at lines 204-246 in libs/mailer/src/mailer.test.ts expect a thrown error but the new code will not throw.
New 'disabled' mode behavior (not yet tested)
- Sending email in disabled mode - should log a warning and not attempt to send
- Verifying SMTP connection in disabled mode - should return
true(no connection to verify) - Creating mailer from env in production without SMTP - should create mailer with
mode: 'disabled'
Files affected
libs/mailer/src/mailer.ts(lines 81-86, 145-155)libs/mailer/src/mailer.test.ts(tests to add/update)
Acceptance criteria
- Update existing tests that expect thrown error for missing SMTP config
- Add test for
send()in disabled mode (logs warning, returns early) - Add test for
verify()in disabled mode (returns true) - Add test for
createMailerFromEnv()in production without SMTP config (creates disabled mode)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
🆕 New