mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 16:46:00 +00:00
21 lines
732 B
TypeScript
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();
|
|
});
|
|
});
|