fix 100% progress output

This commit is contained in:
Tobias Koppers 2019-08-02 08:48:28 +02:00
parent 5344837ed6
commit 7cfe0e6a41
2 changed files with 4 additions and 1 deletions

View File

@ -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)];

View File

@ -49,6 +49,7 @@ describe("ProgressPlugin", function() {
"omit arguments when no space"
);
expect(logs).toContain("93% ...hunk asset optimization");
expect(logs).toContain("100%");
});
});