Skip to content

refactor: extract internal process-event module and split tests#82

Open
adavila0703 wants to merge 1 commit into
mainfrom
feature/processor-event-internal-module
Open

refactor: extract internal process-event module and split tests#82
adavila0703 wants to merge 1 commit into
mainfrom
feature/processor-event-internal-module

Conversation

@adavila0703
Copy link
Copy Markdown
Member

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.

- 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
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.06%. Comparing base (7a24177) to head (73480e6).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant