You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
jsdom for every test, or a Node environment for main-process and shell-config tests #289
Jest runs all tests under jsdom today, and docs/agents/checks.md records a setImmediate workaround for main-process tests under jsdom. Does Vitest keep jsdom everywhere, or do tests under src/main/, the shell-config tests and e2e/helpers run under Node? If split, by what mechanism: per-file comment, glob, or projects?
jsdom for every test: the same setup everywhere. One vitest.config with environment: 'jsdom', one ordered setupFiles list (bridge setup, then the MobX action-warning check) applied to all 66 test files. No projects, no per-file environment comments.
Why: the driving dev chose one setup for all tests, as under Jest today, over a Node environment for the 21 tests that need no DOM (src/main/**, the shell-config tests at src/*.test.js, e2e/helpers/**).
Considered and rejected: two inline test.projects (page under jsdom, node for the rest). Vitest 5.1.1 has no environmentMatchGlobs; projects or a // @vitest-environment comment are its only ways to mix environments.
Left to the spike, not decided here: Vitest's jsdom environment keeps Node's setImmediate visible. That may make the polyfill in src/main/updates.test.js redundant, and docs/agents/checks.md says it makes React's scheduler race jsdom teardown. The spike task observes both.
Activity
jtklein-agents commentedon Nov 22, 2026
Resolution
jsdom for every test: the same setup everywhere. One
vitest.configwithenvironment: 'jsdom', one orderedsetupFileslist (bridge setup, then the MobX action-warning check) applied to all 66 test files. No projects, no per-file environment comments.src/main/**, the shell-config tests atsrc/*.test.js,e2e/helpers/**).test.projects(pageunder jsdom,nodefor the rest). Vitest 5.1.1 has noenvironmentMatchGlobs; projects or a// @vitest-environmentcomment are its only ways to mix environments.setImmediatevisible. That may make the polyfill insrc/main/updates.test.jsredundant, anddocs/agents/checks.mdsays it makes React's scheduler race jsdom teardown. The spike task observes both.