Skip to content

jsdom for every test, or a Node environment for main-process and shell-config tests #289

Closed

Description

@jtklein-agents

Question

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?

Activity

  1. added
    wayfinder:grilling
    on Nov 22, 2026
  2. jtklein-agents commented on Nov 22, 2026

    @jtklein-agents
    OwnerAuthor

    Resolution

    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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:grilling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions