mirror of
https://github.com/stablyai/agent-slack.git
synced 2026-09-19 01:06:54 +08:00
13 lines
458 B
TypeScript
13 lines
458 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { htmlToMarkdown } from "../src/slack/html-to-md.ts";
|
|
|
|
describe("htmlToMarkdown", () => {
|
|
test("converts basic HTML to markdown", () => {
|
|
const md = htmlToMarkdown(
|
|
'<html><body><h1>Title</h1><p>Hello <a href="https://example.com">world</a>.</p></body></html>',
|
|
).trim();
|
|
expect(md).toContain("# Title");
|
|
expect(md).toContain("Hello [world](https://example.com).");
|
|
});
|
|
});
|