Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
import { TSmtpSendMail, TSmtpService } from "@app/services/smtp/smtp-service";
export type TTestSmtpService = TSmtpService & {
getEmails: () => TSmtpSendMail[];
getLastEmail: () => TSmtpSendMail | undefined;
clear: () => void;
};
export const mockSmtpServer = (): TTestSmtpService => {
const storage: TSmtpSendMail[] = [];
return {
sendMail: async (data) => {
storage.push(data);
},
verify: async () => {
return true;
},
getEmails: () => storage,
getLastEmail: () => storage[storage.length - 1],
clear: () => {
storage.length = 0;
}
};
};