refactor: extract internal process-event module and split tests#82
Open
adavila0703 wants to merge 1 commit into
Open
refactor: extract internal process-event module and split tests#82adavila0703 wants to merge 1 commit into
adavila0703 wants to merge 1 commit into
Conversation
- Move processEvent implementation to process-event.ts (not re-exported from package entry) - Add processor-defaults.ts for shared defaults/backoff to avoid import cycles - Add processor-event.test.ts for direct processEvent coverage - Extend processor integration tests (wakeup, poll limits, shutdown timeout) - Keep defaultBackoff public API via processor re-export
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
===========================================
+ Coverage 86.48% 99.06% +12.58%
===========================================
Files 7 9 +2
Lines 429 428 -1
Branches 82 82
===========================================
+ Hits 371 424 +53
+ Misses 54 4 -50
+ Partials 4 0 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
This change pulls single-event processing out of processor.ts into an internal process-event.ts module so it can be unit-tested without adding anything to the public txob entrypoint. Shared numeric defaults and defaultBackoff live in processor-defaults.ts to avoid a runtime import cycle between processor and process-event. Direct processEvent tests live in processor-event.test.ts; processor.test.ts keeps EventProcessor integration coverage (including wakeup/poll edge cases and shutdown timeout behavior).
Why
• Keeps processEvent off the package API while still allowing focused tests.
• Separates “one event” logic from polling/wakeup orchestration.
Testing
• yarn test:ci (all tests + coverage) — passing.
Notes
• defaultBackoff remains part of the public API via re-export from processor.ts (implementation in processor-defaults.ts).
• No README updates: nothing new is documented as a user-facing import from txob.