Complete worked example
typescript
import { test, expect } from "../support/test.js";
async function loadTitles(read: () => Promise<string[]>): Promise<string[]> {
return (await read()).map(title => title.trim());
}
test("normalizes repository output", async () => {
expect(await loadTitles(async () => [" QA "])).toEqual(["QA"]);
});- Reasoning
- Only the repository is replaced; the normalizer still executes.