/
vasya2
/
var
Обзор
Документация
Войти
/
vasya2
/
var
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
api/src/plugins/mailer.test.ts
22 строки
495 B
Oliver Eyton-Williams
chore(api): migrate to fastify v5 (#57576)
02 июн 2025, 05:37
Не верифицирован
02 июн 2025, 05:37
89402ca
Код
Авторство
О чём код?
import Fastify from 'fastify'; import mailer from './mailer'; describe('mailer', () => { it('should send an email via the provider', async () => { const fastify = Fastify(); const send = jest.fn(); await fastify.register(mailer, { provider: { send } }); const data = { to: 'test@add.ress', from: 'team@freecodecamp.org', subject: 'test', text: 'test' }; await fastify.sendEmail(data); expect(send).toHaveBeenCalledWith(data); }); });