mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
22 lines
710 B
TypeScript
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();
|
|
});
|
|
});
|