import { expect, test } from "bun:test" import { emDashOveruse } from "./em-dash-overuse" import { checkSource } from "./support/check-source" test.each([ [`

${"a — b ".repeat(8)}

`, 1], [`

${"a -- b ".repeat(8)}

`, 1], [`

${"a --- b ".repeat(8)}

`, 0], [`

${"a — b ".repeat(7)}

`, 0], [`

${"a — b ".repeat(8)}${"x".repeat(5000)}

`, 0], ])("#given page dash source #then returns %i findings", (source, count) => { expect(checkSource(emDashOveruse, source, { path: "a.astro" })).toHaveLength(count) })