Testing · Junior · Question 29 of 78
Which environment do component tests usually run in under Jest/Vitest?
- ✓Correct answer: jsdom or happy-dom - a DOM emulation in Node.js
- 2A real Chrome window opened for each test
- 3A plain Node.js environment without any DOM
Explanation
In Vitest it is set with environment: "jsdom"; in Jest - testEnvironment: "jsdom". The emulation has no real layout or rendering.