Skip to content

Commit

Permalink
Merge pull request #9512 from webpack/bugfix/100-percent
Browse files Browse the repository at this point in the history
fix 100% progress output
  • Loading branch information
sokra committed Aug 2, 2019
2 parents 5344837 + 7cfe0e6 commit 5a9d029
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/logging/truncateArgs.js
Expand Up @@ -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)];
Expand Down
1 change: 1 addition & 0 deletions test/ProgressPlugin.test.js
Expand Up @@ -49,6 +49,7 @@ describe("ProgressPlugin", function() {
"omit arguments when no space"
);
expect(logs).toContain("93% ...hunk asset optimization");
expect(logs).toContain("100%");
});
});

Expand Down

0 comments on commit 5a9d029

Please sign in to comment.