Repository navigation
feat(extension-sdk): add the base element in unit tests - #3800
Merged
Merged
Conversation
Web always has <base href="/"> and helpers like buildUrl rely on it for history mode. Extensions run their unit tests with the SDK config, which had no setup file, so each spec had to add the element itself. The SDK now ships a setup file that adds it, like the web unit test setup.
dschmidt
force-pushed
the
feat/extension-sdk-vitest-base
branch
from
October 20, 2026 08:55
f177b72 to
8718f5a
Compare
JammingBen
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #3798.
Web always has
<base href="/">, and since #3798 the web unit tests add it invitest.init.ts. Extensions run their unit tests with the test config fromdefineConfigof the extension SDK, which had no setup file. So an extension test that reachesbuildUrlhad to add the element itself.The SDK now ships
dist/vitest.setup.js, which adds the element, and sets it assetupFilesin the test config. AsetupFilesof the extension is merged in, not replaced (mergeConfigconcatenates arrays).The path is built from
dirname(import.meta.url), because Vite turnsnew URL('./vitest.setup.js', import.meta.url)into an inlined asset at build time.Related Issue
How Has This Been Tested?
<base>block removed from the spec: they pass, and fail with the released SDKsetupFilesentry in the extension config runs as wellTypes of changes