From e5d0f2714be23f50c44c45a34e90d10b279687aa Mon Sep 17 00:00:00 2001 From: Logan Date: Sun, 23 Aug 2026 04:36:46 -0400 Subject: [PATCH] test(ui): make ui-visual-update honour its file filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vitest parses a bare `--update` as taking the next positional as its value, so `make ui-visual-update UI_ARGS=` handed the path to the flag and ran with no filter at all: 99 files, every baseline in the repo re-recorded, any stale one blessed in silence. Two paths were worse still — the first was eaten and only the second ran. That is #196's own hazard living in the tool meant to resolve it: the rule is "refresh the reference your change moved and never one you did not cause", and the documented way to refresh one refreshed the set. `--update=true` is the whole fix, with the reason beside it because `=true` reads like something to tidy away. `make ui-visual` and `make ui-test` are unaffected — their `$(UI_ARGS)` follows `run`, with no flag to swallow it — and no other target interpolates a variable after a boolean flag. Closes #204 --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fb3e26c..75cba25 100644 --- a/Makefile +++ b/Makefile @@ -160,8 +160,11 @@ ui-watch: ## Same suite, in watch mode ui-visual: ## Run the suite including screenshot comparisons @cd frontend && YJ_VISUAL=1 npx vitest run $(UI_ARGS) -ui-visual-update: ## Re-record the screenshot baselines - @cd frontend && YJ_VISUAL=1 npx vitest run --update $(UI_ARGS) +# `--update=true`, never a bare `--update`: vitest takes the following +# positional as the flag's value, so `--update ` swallows the path +# and re-records every baseline in the repo instead of the one named. +ui-visual-update: ## Re-record the screenshot baselines (UI_ARGS= to filter) + @cd frontend && YJ_VISUAL=1 npx vitest run --update=true $(UI_ARGS) ui-setup: ## Install the Vitest browser provider's own Chromium (once) @cd frontend && pnpm install && npx playwright install chromium