Repository navigation
fix(ci): repair 3 pre-existing DEV unit-test breakages - #3039
Merged
Merged
Conversation
1. hugo/layouts/shortcodes/tut-menu.html: `contains` is not a Hugo function; the operands are strings → use `strings.Contains`. The bad token broke the Hugo build (exit 1), cascading to 4 hugo-homepage-partials failures (#8c2028daa). 2. package.json prebuild:parsers-bundle: align esbuild banner with the aliased `createRequire as __cjsBundleRequire` convention already used by bundle-shared.cjs. The bare `createRequire` collided with esbuild-emitted createRequire imports (from directives/ui.ts + reference-links.ts), throwing SyntaxError at module-load for 5 srv-qa test files. 3. Update 3 stale test assertions to match the intentional callout refactor (#18e713de5, #71a8d70bc): alerts now render as <aside>/<details> via the tut-alert partial and the CSS sibling rule broadened to `~ :is(blockquote, aside, details)`. Tests, not source, were behind.
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.
Follow-up to #3036 (merged), which fixed the bundle-step crash. With that unblocked, the
unitjob ran and surfaced 3 independent pre-existing breakages on DEV (all present on the pre-#3036 DEV baseline — not introduced by #3036). This PR fixes all three so the unit job goes green.1. Hugo build broken —
containsis not a Hugo functionhugo/layouts/shortcodes/tut-menu.html:21usedcontains . "→".containsis not a Go-template/Hugo function; the operands are both strings, so this is a substring test →strings.Contains. The parse error failed the Hugo build (exit 1), cascading to 4 failures inhugo-homepage-partials.test.ts(homepage, /learn/, tutorial-navigator, featured-missions never built). Introduced by the new-file commit8c2028daa.2. srv-qa parsers.bundle — duplicate
createRequiredeclarationprebuild:parsers-bundle(package.json) injected a banner with the barecreateRequire, colliding with esbuild-emittedimport { createRequire } from 'node:module'carried in fromscripts/parsers/directives/ui.ts+reference-links.ts→SyntaxError: Identifier 'createRequire' has already been declared(surfaced as an oxcvite:definetransform error), failing 5 srv-qa test files at module load. Fix: use the aliased bannercreateRequire as __cjsBundleRequire— the exact conventionscripts/bundle-shared.cjsalready documents and uses for the sibling bundles.3. Stale test assertions vs. the intentional callout/alert refactor
Commits
18e713de5(CSS) and71a8d70bc(render hook) deliberately moved alerts to<aside>/<details>rendered via thetut-alert.htmlpartial, and broadened the CSS sibling rule to~ :is(blockquote, aside, details). Three string-matching tests were left behind (source is correct):option-codeblock-indent-css.test.ts:~ blockquote→~ :is(blockquote, aside, details).option-tail-leak.test.ts:blockquote.alert-tip→aside.alert.alert-tip(the real rendered element).render-blockquote-hook.test.ts: assert the hook delegates totut-alert.htmlpassing.AlertType, and that the partial emitsclass="alert alert-{{ $type }}"— preserving the coverage intent against the new architecture.Verification
parsers.bundle.mjswith the aliased banner → no duplicate top-levelcreateRequire;node --checkpasses (valid ESM).option-tail-leak,hugo-homepage-partials) rely on the Hugo build, which CI runs; confirmed locally that thecontains→strings.Containsfix is the only blocker on the build path and the newaside.alert.alert-tipselector matchestut-alert.html's output for a non-collapsibletip.🤖 Generated with Claude Code