Performance: Mocking data in tests
LOW IMPACT
Mocking data in tests affects test execution speed and resource usage during development, not the live page load or rendering performance.
const mockData = { id: 1, name: 'Test' };
// In test
render(<Component data={mockData} />);import { fetchData } from '~/api'; // In test const data = await fetchData(); render(<Component data={data} />);
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Real API calls in tests | N/A | N/A | N/A | [X] Bad |
| Static mock data in tests | N/A | N/A | N/A | [OK] Good |