Files
bknd/app/src/core/drivers/email/mailchannels.spec.ts
T
2025-06-17 19:51:12 +02:00

21 lines
732 B
TypeScript

import { describe, it, expect } from "bun:test";
import { mailchannelsEmail } from "./mailchannels";
const ALL_TESTS = !!process.env.ALL_TESTS;
describe.skipIf(ALL_TESTS)("mailchannels", () => {
it("should throw on failed", async () => {
const driver = mailchannelsEmail({ apiKey: "invalid" } as any);
expect(driver.send("foo@bar.com", "Test", "Test")).rejects.toThrow();
});
it("should send an email", async () => {
const driver = mailchannelsEmail({
apiKey: process.env.MAILCHANNELS_API_KEY!,
from: { email: "accounts@bknd.io", name: "Dennis Senn" },
});
const response = await driver.send("ds@bknd.io", "Test", "Test");
expect(response).toBeDefined();
});
});