fix(shared): default non-finite string sample limits

This commit is contained in:
Peter Steinberger
2026-05-28 22:35:00 -04:00
parent 19d9e71b84
commit 7f6579e416
2 changed files with 11 additions and 1 deletions

View File

@@ -43,6 +43,15 @@ describe("summarizeStringEntries", () => {
).toBe("a, b, c, d, e, f (+1)");
});
it("uses the default limit for non-finite limits", () => {
expect(
summarizeStringEntries({
entries: ["a", "b", "c", "d", "e", "f", "g"],
limit: Number.NaN,
}),
).toBe("a, b, c, d, e, f (+1)");
});
it("does not add a suffix when the limit exactly matches the entry count", () => {
expect(
summarizeStringEntries({