test(editor): add warn to logger mock so suite runs without Supabase env - #8
Merged
Merged
Conversation
The mocked createLogger returned only debug/error/info. On checkouts without VITE_SUPABASE_* set, src/infrastructure/supabase/client.ts calls logger.warn at import time, so the whole editor.test.tsx suite died with 'logger.warn is not a function' before running a single test.
MeepCastana
approved these changes
Aug 6, 2026
MeepCastana
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed locally on a combined review branch (all six merged clean, no conflicts). CI green. Approved.
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.
What
On a fresh checkout without
VITE_SUPABASE_URL/VITE_SUPABASE_PUBLISHABLE_KEY,npm run test:runfails before running a single test ineditor.test.tsx:client.tscallslogger.warnat import time when Supabase env is missing, but the suite'screateLoggermock only provideddebug/error/info. On machines with the env configured the warn path never runs, which is why this only shows up on unconfigured checkouts.How
Add
warn: vi.fn()to the mock — one line.Verification
bunx vitest run src/features/editor/components/editor.test.tsxwith no Supabase env: suite passes (2 tests). Fulltest:runis green with this applied: 211 files, 1259 tests.