No DOM test environment detected
Vitest runs in a Node environment by default. DOM tests usually need environment: 'jsdom' or 'happy-dom'.
Vitest jsdom environment preflight
Paste sanitized Vitest config, dependency names, and the relevant error. The checker reviews jsdom, happy-dom, setupFiles, globals, and per-file environment clues without running tests or reading source files.
The pasted Vitest config has likely DOM environment blockers.
Vitest runs in a Node environment by default. DOM tests usually need environment: 'jsdom' or 'happy-dom'.
The pasted error mentions missing browser globals, but the config does not show a DOM environment.
This is valid, but keep TypeScript test globals configured separately if the editor still reports missing names.
Vitest jsdom/happy-dom environment preflight Status: fail Summary: The pasted Vitest config has likely DOM environment blockers. Parsed config: - target: dom - environment: missing - setupFiles: missing - globals: true - jsdom dependency: no - happy-dom dependency: no - per-file environment: no Findings: - fail: No DOM test environment detected - Vitest runs in a Node environment by default. DOM tests usually need environment: 'jsdom' or 'happy-dom'. - fail: Error text points to missing DOM globals - The pasted error mentions missing browser globals, but the config does not show a DOM environment. - info: Vitest globals are enabled - This is valid, but keep TypeScript test globals configured separately if the editor still reports missing names. Checklist: - Use jsdom or happy-dom for tests that touch document, window, or rendered components. - Keep jsdom or happy-dom in devDependencies when that environment is selected. - Put matchers and polyfills in setupFiles when every test needs them. - Run the real Vitest suite after this static preflight.
It checks static Vitest config for jsdom, happy-dom, setupFiles, globals, DOM error clues, and whether the selected environment has a matching devDependency.
It does not run Vitest, execute app code, install dependencies, inspect your repository, or prove that rendered component tests are correct.