it("joins short lists without a suffix", () => {
expect(summarizeStringEntries({ entries: ["a", "b"], limit: 4 })).toBe("a, b");
});
it("adds a remainder suffix when truncating", () => {
expect(
summarizeStringEntries({
entries: ["a", "b", "c", "d", "e"],
limit: 4,
}),
).toBe("a, b, c, d (+1)");
});
it("uses a floored limit and clamps non-positive values to one entry", () => {
expect(
summarizeStringEntries({
entries: ["a", "b", "c"],
limit: 2.8,
}),
).toBe("a, b (+1)");
expect(
summarizeStringEntries({
entries: ["a", "b", "c"],
limit: 0,
}),
).toBe("a (+2)");
});
it("uses the default limit when none is provided", () => {
expect(
summarizeStringEntries({
entries: ["a", "b", "c", "d", "e", "f", "g"],
}),
).toBe("a, b, c, d, e, f (+1)");
});
it("does not add a suffix when the limit exactly matches the entry count", () => {
expect(
summarizeStringEntries({
entries: ["a", "b", "c"],
limit: 3,
emptyText: "ignored",
}),
).toBe("a, b, c");
});
});
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.