mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
finalize initial app resources/drivers
This commit is contained in:
21
app/src/core/drivers/email/resend.spec.ts
Normal file
21
app/src/core/drivers/email/resend.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user