From 7cfe0e6a41f1e87b4c1ef45c5c1cfe582f5c39a2 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 2 Aug 2019 08:48:28 +0200 Subject: [PATCH] fix 100% progress output --- lib/logging/truncateArgs.js | 4 +++- test/ProgressPlugin.test.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/logging/truncateArgs.js b/lib/logging/truncateArgs.js index 53f52c835..8522586bc 100644 --- a/lib/logging/truncateArgs.js +++ b/lib/logging/truncateArgs.js @@ -15,7 +15,9 @@ const truncateArgs = (args, maxLength) => { const availableLength = maxLength - lengths.length + 1; if (availableLength > 0 && args.length === 1) { - if (availableLength > 3) { + if (availableLength >= args[0].length) { + return args; + } else if (availableLength > 3) { return ["..." + args[0].slice(-availableLength + 3)]; } else { return [args[0].slice(-availableLength)]; diff --git a/test/ProgressPlugin.test.js b/test/ProgressPlugin.test.js index f202a31eb..6e0afda06 100644 --- a/test/ProgressPlugin.test.js +++ b/test/ProgressPlugin.test.js @@ -49,6 +49,7 @@ describe("ProgressPlugin", function() { "omit arguments when no space" ); expect(logs).toContain("93% ...hunk asset optimization"); + expect(logs).toContain("100%"); }); });