substr/tests/feeds_test.ts

18 lines
581 B
TypeScript

import { describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { cleanContentHtml } from "../feeds.ts";
describe("Feeds", () => {
describe("#cleanContentHtml", () => {
const articleHtml = Deno.readTextFileSync(
"tests/fixtures/gfm-content-1.html",
);
it("removes the anchor links for headlines", () => {
const cleanHtml = cleanContentHtml(articleHtml);
expect(cleanHtml).not.toMatch(/<a class="anchor" aria-hidden="true"/);
expect(cleanHtml).not.toMatch(/<svg class="octicon octicon-link"/);
});
});
});