Skip to content

fix(test): un-break unit CI — match island-src partial in module-load guards - #1620

Merged
jung-thomas merged 1 commit into
mainfrom
worktree-fix-stale-island-src-tests
Aug 11, 2026
Merged

fix(test): un-break unit CI — match island-src partial in module-load guards#1620
jung-thomas merged 1 commit into
mainfrom
worktree-fix-stale-island-src-tests

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

Unit-test CI has failed on every main run since #1609 (worktree-fingerprint-js-i…). Not transitory — two tests fail deterministically:

  • test/unit/reset-tutorial-progress.test.jshead.html loads the tutorial-reset.js bundle as a module
  • test/unit/hugo/personalizer-script-is-module.test.tsloads /js/homepage-personalizer.js with type=module

CI summary: 2 failed | 7842 passed.

Root cause

The island-fingerprinting work (#1609/#1611) replaced the literal bundle paths in the Hugo templates with the fingerprinting partial:

Template Before After
baseof.html:71 src="/js/homepage-personalizer.js" src="{{ partial \"island-src.html\" \"homepage-personalizer\" }}"
head.html:160 src="/js/tutorial-reset.js" src="{{ partial \"island-src.html\" \"tutorial-reset\" }}"

Both regression guards still asserted the old literal src against the raw template source, so the regex matched null. The type="module" attribute the tests actually care about is still present in both templates — pure test staleness, not a production regression.

Fix

Update both regexes to accept either the fingerprinted partial form or the literal path, while still asserting type="module" (the real regression intent: these Vite bundles begin with import and break if loaded as classic scripts).

Swept test/ for any other literal src="/js/*.js" guards against island-src-migrated templates — none remain.

Verification

  • reset-tutorial-progress.test.js → 44/44 pass
  • personalizer-script-is-module.test.ts → 1/1 pass

The island-fingerprinting change replaced literal bundle paths
(src="/js/tutorial-reset.js", src="/js/homepage-personalizer.js") in
head.html / baseof.html with the {{ partial "island-src.html" ... }}
fingerprinting partial. Two regression guards still asserted the old
literal src strings, so they matched null and failed on every main CI
run since #1609.

Update both regexes to accept either the fingerprinted partial form or
the literal path, while still asserting type="module" (the actual
regression intent: these Vite bundles start with import and break if
loaded as classic scripts).
@jung-thomas
jung-thomas merged commit 0f4e425 into main Aug 11, 2026
2 of 3 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-stale-island-src-tests branch August 11, 2026 01:08
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