Repository navigation
ci(web): run the four src/lib test files no script named - #689
Open
shuhuNB515 wants to merge 1 commit into
Open
shuhuNB515 wants to merge 1 commit into
shuhuNB515 wants to merge 1 commit into
Conversation
activity-merge, chat-mentions, format and http-href had tests on disk that pass, but no package.json script named them and the web job runs each script by name, so their 15 assertions could not fail a build. http-href is the guard that refuses javascript:, data: and vbscript: URLs before they reach an href, so a regression there was an unenforced XSS vector. Add one script per file, matching the existing shape, and one web job step per script. Closes BaaRai#678. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Closes #678.
Problem
Four test files under
web/src/lib/had nopackage.jsonscript, and thewebCI job runs each script by name rather than a glob, so nothing ran them:src/lib/activity-merge.test.mjsactivity-merge.tssrc/lib/chat-mentions.test.mjschat-mentions.tssrc/lib/format.test.mjsformat.tssrc/lib/http-href.test.mjshttp-href.ts15 assertions that could not fail a build. The one that matters most is
http-href:httpHrefis the guard that refusesjavascript:,data:andvbscript:URLs before they reach an href, so a regression there is an XSS vector that CI would have merged green.Behavior
The issue offered two shapes: four scripts and four CI steps, or one
test:libglob. This takes the first, because it matches the existing one-script-per-file convention and does not runtest:bash,test:navigation,test:chat-filterandtest:openai-compatiblea second time through a glob.web/package.json:test:activity-merge,test:chat-mentions,test:format,test:http-href, eachnode --test <file>..github/workflows/ci.yml: onewebjob step per new script, beforebuild:static.### Added.No test, source or TypeScript file is touched.
Tests
Closure checked mechanically on the branch — every
*.test.mjson disk is named by a script, and everytest:*script appears inci.yml:All 16 web scripts pass locally (Node 24.21.0), including the four new ones:
npx tsc --noEmitis clean, andci.ymlstill parses as YAML with all seven jobs.Note:
npx biome check package.jsonreports one formatting difference in the pre-existinglint-stagedarray. It is identical before and after this change (that is #612), so it is left alone here.