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 8e518e3 commit 96680aa
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ const __dirname = dirname(__filename);
});

// Save reports
fs.writeFileSync("lighthouse-report.html", lhr.report);
fs.writeFileSync(
"lighthouse-reports/report.json",
JSON.stringify(lhr, null, 2)
);
if (lhr.report) {
fs.writeFileSync("lighthouse-report.html", lhr.report);
fs.writeFileSync(
"lighthouse-reports/report.json",
JSON.stringify(lhr, null, 2)
);
} else {
throw new Error("Lighthouse report is undefined");
}

await browser.close();
} catch (error) {
Expand Down

0 comments on commit 96680aa

Please sign in to comment.