diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index 82dae694368c45..52c61c40b3a32b 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -314,13 +314,14 @@ function createErrDiff(actual, expected, operator) { } function addEllipsis(string) { - const lines = StringPrototypeSplit(string, '\n'); + const lines = StringPrototypeSplit(string, '\n', 11); if (lines.length > 10) { lines.length = 10; return `${ArrayPrototypeJoin(lines, '\n')}\n...`; } else if (string.length > 512) { return `${StringPrototypeSlice(string, 512)}...`; } + return string; } class AssertionError extends Error {