UNPKG

@casoon/auditmysite

Version:

Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe

54 lines (41 loc) โ€ข 1.83 kB
const { HTMLGenerator } = require('./dist/generators/html-generator'); const fs = require('fs'); const path = require('path'); async function testEnhancedGenerator() { console.log('๐Ÿงช Testing Enhanced HTML Generator...'); try { const generator = new HTMLGenerator(); const jsonPath = path.join(__dirname, 'test-enhanced-reports', 'test-data.json'); console.log('๐Ÿ“„ Loading test data from:', jsonPath); const htmlContent = await generator.generateFromJSON(jsonPath); const outputPath = path.join(__dirname, 'test-enhanced-reports', 'enhanced-report.html'); fs.writeFileSync(outputPath, htmlContent, 'utf8'); console.log('โœ… Enhanced HTML report generated successfully!'); console.log('๐Ÿ“„ Report saved to:', outputPath); // Check if the HTML contains expected elements if (htmlContent.includes('certificate-badge')) { console.log('โœ… Certificate badge found in HTML'); } else { console.log('โŒ Certificate badge NOT found in HTML'); } if (htmlContent.includes('sticky-nav')) { console.log('โœ… Sticky navigation found in HTML'); } else { console.log('โŒ Sticky navigation NOT found in HTML'); } if (htmlContent.includes('Grade C')) { console.log('โœ… Grade display found in HTML'); } else { console.log('โŒ Grade display NOT found in HTML'); } if (htmlContent.includes('Overall Score: 75/100')) { console.log('โœ… Overall score found in HTML'); } else { console.log('โŒ Overall score NOT found in HTML'); } console.log('๐Ÿ”— Open the HTML file in your browser to see the enhanced report with certificate badges!'); } catch (error) { console.error('โŒ Error testing enhanced generator:', error); } } testEnhancedGenerator();