From 53f7ac0a39e346b0c515c4f10486f4e6dadc4bdf Mon Sep 17 00:00:00 2001 From: Raphaelle Cantin Date: Mon, 23 Sep 2024 17:00:13 +0100 Subject: [PATCH] Simplify log --- pa11y/webapp/write-report.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/pa11y/webapp/write-report.js b/pa11y/webapp/write-report.js index 5063b442da..a7a0bc67f5 100644 --- a/pa11y/webapp/write-report.js +++ b/pa11y/webapp/write-report.js @@ -122,23 +122,18 @@ Promise.all(promises) ]; if (isPullRequestRun && fakeResults.length > 0) { const resultsLog = fakeResults - .map(result => - result.issues.map(issue => { - return { - title: result.documentTitle, - url: result.pageUrl, - type: - issue.type === 'error' - ? chalk.redBright(issue.type) - : chalk.yellow(issue.type), - message: issue.message, - }; - }) - ) + .map(result => ({ + title: result.documentTitle, + url: result.pageUrl, + errors: result.issues.map(issue => ({ + type: issue.type, + message: issue.message, + })), + })) .flat(); console.error(`!!! ${chalk.redBright('Fix these before merging')}`); - console.log(resultsLog); + console.log(...resultsLog); // TODO do we want it to stop people from merging also when it's of type "warning" or "notice"? if (