(Component, props, iterations = 10)
| 68 | |
| 69 | // Render component and measure time |
| 70 | function measureRenderTime(Component, props, iterations = 10) { |
| 71 | const times = []; |
| 72 | |
| 73 | for (let i = 0; i < iterations; i++) { |
| 74 | const start = performance.now(); |
| 75 | const { unmount } = render(<Component {...props} />); |
| 76 | const end = performance.now(); |
| 77 | times.push(end - start); |
| 78 | unmount(); |
| 79 | } |
| 80 | |
| 81 | // Return median to reduce variance |
| 82 | times.sort((a, b) => a - b); |
| 83 | return times[Math.floor(times.length / 2)]; |
| 84 | } |
| 85 | |
| 86 | describe("Performance Benchmarks", () => { |
| 87 | // Store results for snapshot comparison |
no outgoing calls
no test coverage detected
searching dependent graphs…