()
| 218 | |
| 219 | // Main execution |
| 220 | async function main() { |
| 221 | log('Storybook Performance Testing', colors.bright + colors.blue); |
| 222 | log('This may take a few minutes...\n'); |
| 223 | |
| 224 | const results = {}; |
| 225 | |
| 226 | // Measure build time |
| 227 | results.buildTime = measureBuildTime(); |
| 228 | |
| 229 | if (results.buildTime) { |
| 230 | // Analyze build output |
| 231 | results.analysis = analyzeBuildOutput(); |
| 232 | |
| 233 | // Identify slow components |
| 234 | results.storyFiles = identifySlowComponents(); |
| 235 | |
| 236 | // Generate report |
| 237 | generateReport(results); |
| 238 | } else { |
| 239 | log('\nPerformance testing incomplete due to build failure.', colors.red); |
| 240 | process.exit(1); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | main().catch(error => { |
| 245 | console.error('Error running performance tests:', error); |
no test coverage detected