Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

731 B
Raw Blame
import { describe, expect, it } from "vitest";
import { singleLineTitle } from "./title-text";

describe("singleLineTitle", () => {
  it.each([
    [
      "why did <https://example.com/runs/1?a=b|this run> fail?",
      "why did this run fail?",
    ],
    ["see <https://example.com/runs/1>", "see https://example.com/runs/1"],
    ["read [the report](https://example.com/r.md)", "read the report"],
    [
      'why is it stuck? ```{\n  "id": "1"\n}```',
      'why is it stuck? { "id": "1" }',
    ],
    ["fix `useSearchRows`\n\nsecond line", "fix useSearchRows second line"],
    ["  spaced   out  ", "spaced out"],
  ])("reads %j as one line", (raw, expected) => {
    expect(singleLineTitle(raw)).toBe(expected);
  });
});