13 lines
604 B
JavaScript
13 lines
604 B
JavaScript
import { describe, expect, it } from 'vitest'
|
|
import { isMailerReady, MailerNotReadyError, sendConfirmationEmail } from './mailer.js'
|
|
|
|
describe('mailer readiness', () => {
|
|
it('reports missing SMTP configuration without exposing credentials', async () => {
|
|
expect(isMailerReady()).toBe(false)
|
|
await expect(sendConfirmationEmail('test@example.invalid', 'contact', 'synthetic-token'))
|
|
.rejects.toBeInstanceOf(MailerNotReadyError)
|
|
await expect(sendConfirmationEmail('test@example.invalid', 'contact', 'synthetic-token'))
|
|
.rejects.toMatchObject({ code: 'MAILER_NOT_READY' })
|
|
})
|
|
})
|