Untitled

 avatar
unknown
plain_text
6 months ago
593 B
5
Indexable
// Helper function to format results array to string
const formatResults = (results) => {
  if (results.length === 0) return '🚨 No Lighthouse results collected!\n';

  return results.map((result, index) => `
🚨 Test #${index + 1} Scores:
- Performance: ${result.lhr.categories.performance.score * 100}
- Accessibility: ${result.lhr.categories.accessibility.score * 100}
- Best Practices: ${result.lhr.categories['best-practices'].score * 100}
- SEO: ${result.lhr.categories.seo.score * 100}
`).join('\n');
};

const formattedResults = formatResults(global.lighthouseResults);
Editor is loading...
Leave a Comment