Print the installed Vitest and happy-dom versions side by side and upgrade or pin happy-dom to a release that supports that Vitest version. Expected output: both versions are listed and are a supported pairing.

In the Vitest config, set the test environment to happy-dom and turn on globals in the same config block. Expected output: the config loads with no unknown-option warnings.

Remove per-file environment comments that conflict with the config, and remove any jsdom-specific setup file still referenced by setupFiles. Expected output: only the happy-dom setup path remains.

Move any code that reads window or document out of the top level of setup files and into a beforeAll hook or the tests themselves. Expected output: setup completes without touching window early.

Run one small test file. Expected output: the environment initializes, the test runs, and no globalWindow error appears.