Skip to content

Commit

Permalink
move details limiting back to factory
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra authored and vankop committed Mar 8, 2022
1 parent c14f187 commit ae9c63c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/stats/DefaultStatsFactoryPlugin.js
Expand Up @@ -1823,8 +1823,10 @@ const errorsSpaceLimit = (errors, max) => {
if (fullLength > max) {
result = i > 0 ? errors.slice(0, i) : [];
const overlimit = fullLength - max + 1;
const error = errors[i++];
result.push({
...errors[i++],
...error,
details: error.details.split("\n").slice(0, -overlimit).join("\n"),
filteredDetails: overlimit
});
filtered = errors.length - i;
Expand Down
7 changes: 1 addition & 6 deletions lib/stats/DefaultStatsPrinterPlugin.js
Expand Up @@ -588,12 +588,7 @@ const SIMPLE_PRINTERS = {
"error.loc": (loc, { green }) => green(loc),
"error.message": (message, { bold, formatError }) =>
message.includes("\u001b[") ? message : bold(formatError(message)),
"error.details": (details, { formatError, error }) => {
if (!error.filteredDetails) return formatError(details);
return formatError(
details.split("\n").slice(0, -error.filteredDetails).join("\n")
);
},
"error.details": (details, { formatError }) => formatError(details),
"error.filteredDetails": filteredDetails =>
filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined,
"error.stack": stack => stack,
Expand Down

0 comments on commit ae9c63c

Please sign in to comment.