Testing · Senior · Question 26 of 75
What are the main limitations of jsdom for component tests?
- ✓Correct answer: No layout engine (sizes and positions are 0), no real navigation, missing APIs like
IntersectionObserverandmatchMedia - 2It can't render React
- 3It doesn't support events
Explanation
Polyfill or mock the missing APIs, or move layout-dependent tests to a real browser (Vitest Browser Mode, Playwright CT).