Skip to content

use vi.stubGlobal to handle change to dom-environment-global-assignme… - #4232

Open
OyvindLGjesdal wants to merge 1 commit into
apache:mainfrom
OyvindLGjesdal:update-vitest-dependencies
Open

OyvindLGjesdal wants to merge 1 commit into
apache:mainfrom
OyvindLGjesdal:update-vitest-dependencies

Conversation

@OyvindLGjesdal

@OyvindLGjesdal OyvindLGjesdal commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

…nts-now-update-the-underlying-window

GitHub issue resolved #

Pull request Description:

Fixes failing build when trying to upgrade to vitest 5.x in dependabots #4229

AI assisted, using the migration docs:

Vitest 5 forwards ordinary global assignments to jsdom’s window, so global.document = … hits its getter-only property.
vi.stubGlobal defines a temporary property and vi.unstubAllGlobals() restores the original descriptor. Migration guide
(https://vitest.dev/guide/migration/#dom-environment-global-assignments-now-update-the-underlying-window) · Vitest API (https://vitest.dev/api/vi)

The PR passes with the changes locally, but the migration guide changes some defaults, as well as other breaking changes. I haven't gotten through the full migration guide yet, but can do a read-through to see if anything else looks relevant, as well.


  • Tests are included.
  • Documentation change and updates are provided for the Apache Jena website
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.


See the Apache Jena "Contributing" guide.

@OyvindLGjesdal

OyvindLGjesdal commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Does any other breaking changes or defaults look relevant for the jena codebase in jena-fuseki-ui?

• I found no other Vitest 5 change that currently requires a code fix in jena-fuseki-ui. The full unit suite and coverage run both passed locally: 8 files, 46 tests.

The migration items most relevant to this project are:

I found no uses of the removed sequencing APIs, hoisted mocks inside callbacks, unawaited async assertions, or browser mode features described in the guide.

…-assignments-now-update-the-underlying-window
@OyvindLGjesdal
OyvindLGjesdal force-pushed the update-vitest-dependencies branch from f765edb to d64d482 Compare September 16, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant