Files
bknd/app/src/core/drivers/email/resend.spec.ts
2025-11-05 08:20:36 +01:00

22 lines
710 B
TypeScript

import { describe, it, expect } from "bun:test";
import { resendEmail } from "./resend";
const ALL_TESTS = !!process.env.ALL_TESTS;
describe.skipIf(ALL_TESTS)("resend", () => {
it("should throw on failed", async () => {
const driver = resendEmail({ apiKey: "invalid" } as any);
expect(driver.send("foo@bar.com", "Test", "Test")).rejects.toThrow();
});
it("should send an email", async () => {
const driver = resendEmail({
apiKey: process.env.RESEND_API_KEY!,
from: "BKND <help@bknd.io>",
});
const response = await driver.send("help@bknd.io", "Test", "Test");
expect(response).toBeDefined();
expect(response.id).toBeDefined();
});
});