Skip to content

Commit

Permalink
feature/IVYPORTAL-17377-Create-pipeline-to-run-Lighthouse-report
Browse files Browse the repository at this point in the history
  • Loading branch information
nhthinh-axonivy committed Dec 27, 2024
1 parent 96680aa commit e8e73b0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ const __dirname = dirname(__filename);
});

// Save reports
if (lhr.report) {
fs.writeFileSync("lighthouse-report.html", lhr.report);
if (lhr.report && lhr.report.length > 0) {
fs.writeFileSync("lighthouse-report.html", lhr.report[0]);
fs.writeFileSync(
"lighthouse-reports/report.json",
JSON.stringify(lhr, null, 2)
);
} else {
throw new Error("Lighthouse report is undefined");
throw new Error("Lighthouse report is undefined or empty");
}

await browser.close();
Expand Down

0 comments on commit e8e73b0

Please sign in to comment.