Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Commit 147c166

Browse files
committed
fix(packages/test/unit): 🐛 Fix wrong truncation of last array items
1 parent d790239 commit 147c166

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/test/source/unit/unit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function getStringifiedAndTruncatedArray(array: Array<unknown>): string {
115115
if (length > 6) {
116116
const firstItems = array.slice(0, 3);
117117
const middle = ` ... truncated ${length - 6} samples ...`;
118-
const lastItems = array.slice(-4, -1);
118+
const lastItems = array.slice(-4, length);
119119

120120
return JSON.stringify([...firstItems, "%mid%", ...lastItems], jsonReplacer, 1).replace(/,\n "%mid%",?/, middle);
121121
} else {

0 commit comments

Comments
 (0)