finalize initial app resources/drivers

This commit is contained in:
dswbx
2025-06-17 19:51:12 +02:00
parent 69c8aec6fb
commit aaa97ed113
12 changed files with 170 additions and 62 deletions

View File

@@ -0,0 +1,21 @@
import { describe, it, expect } from "bun:test";
import { resendEmail } from "./resend";
const ALL_TESTS = !!process.env.ALL_TESTS;
describe.skipIf(ALL_TESTS)("resend", () => {
it.only("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();
});
});