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
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'disabled'mode with a warningTests at lines 204-246 in
libs/mailer/src/mailer.test.tsexpect a thrown error but the new code will not throw.New 'disabled' mode behavior (not yet tested)
true(no connection to verify)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
send()in disabled mode (logs warning, returns early)verify()in disabled mode (returns true)createMailerFromEnv()in production without SMTP config (creates disabled mode)