Repository navigation
fix(jest): accept debug: "verbose" in registerCSS and keep a given logger - #595
Merged
danstepanov merged 1 commit intoDec 3, 2026
Conversation
sammoore
approved these changes
Dec 2, 2026
sammoore
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution! Solid fix.
danstepanov
force-pushed
the
fix/register-css-debug-logger
branch
from
December 3, 2026 01:36
5819991 to
7fb5131
Compare
danstepanov
approved these changes
Dec 3, 2026
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.
Fixes #562
Problem
registerCSStypedoptions.debugasboolean, although it passes the options straight tocompileWithAutoDebug, which acceptsboolean | "verbose"and only prints the rule log for"verbose".registerCSS(css, { debug: "verbose" })failed to type-check.compileWithAutoDebugalways calledcompile(css, { ...options, logger })with its own debug logger (orundefined), replacing anyloggerpassed inCompilerOptions. A logger given toregisterCSSorcompileWithAutoDebugwas never called.Fix
registerCSS'sdebugoption toboolean | "verbose" | undefined, matchingcompileWithAutoDebug.compileWithAutoDebug, useoptions.loggerwhen one is given, and fall back to the existing debug logger otherwise. Behaviour without a logger is unchanged.Tests
Added
src/__tests__/native/jest-helpers.test.ts:registerCSSandcompileWithAutoDebugcall a given logger with the same messagescompilesends it. Both fail onmain(the logger receives nothing) and pass with the fix.registerCSS(css, { debug: "verbose" })logs the rules and the compiled output. Onmainthis line failsyarn typecheckwithType 'string' is not assignable to type 'boolean | undefined'.yarn typecheck,yarn linton the changed files and the fullyarn testsuite (109 suites, 2184 tests) pass locally.