Repository navigation
test: cover remendWorklet web/native platform branch - #31
Merged
Merged
Conversation
This was referenced Sep 18, 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.
Summary
Adds a regression test for the web crash fix (#28) — the first coverage of
remendWorklet. #28 shipped without a test since the behavior is decided at module load; this locks it in.What it covers
src/__tests__/remendWorklet.test.tsloads the module fresh per platform (viajest.isolateModules, since the web/native branch is chosen at import time) and asserts:createWorkletRuntimeat module load (the Web: importing StreamdownText crashes at module load (createWorkletRuntime called at module scope) #27 crash: it's a throwing stub on react-native-web)remendon the JS thread and delivers viascheduleOnRN, notscheduleOnRuntimeremendConfigover the defaultsscheduleOnRuntime(not the JS-thread path)Notes
Platformandremendare mocked via stable refs thejest.mockfactories close over, becausejest.isolateModulesre-requires those modules on every load.remendis avirtualmock — itspackage.jsonexposes only an"import"condition, which jest's CommonJS resolver can't load, and the test only needs the stub.Verification
yarn test— 3 suites / 6 passed + 1 todoPlatform.OS === 'web'guard makes the 3 web tests fail (confirms it catches a fix: don't crash on web where worklet runtimes are unavailable #28 regression)yarn typecheckclean,yarn lintclean