• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

reactivando / use-pubsub-js / 28107688098
100%
master: 80%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 24 Jun 2026 02:56PM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Jun 2026 02:55PM UTC coverage: 100.0%. Remained the same
28107688098

push

github

web-flow
test: pin the pub/sub contract before the internal-module migration (#67)

* test: pin the pub/sub contract before the internal-module migration

Adds behavioral/integration tests (coverage was already 100% by branch;
these pin the observable contract so the upcoming pubsub-js -> internal
module swap can't regress it silently). From a subagent gap analysis,
each verified against current behavior.

New cross-hook integration spec (pubsub-integration.spec.ts):
- usePublish delivers to a useSubscribe handler (manual + automatic).

useSubscribe contract:
- delivery is asynchronous (handler not called during publish, only after
  the timer tick) — guards against a sync reimplementation.
- handler receives the exact (token, message) arguments.
- object payloads delivered by reference (not cloned/serialized).
- every independent subscriber on a token receives the message.
- unsubscribe only affects the targeted hook, not co-subscribers.
- Symbol tokens route correctly.

usePublish contract:
- lastPublish transitions true -> false when the subscriber goes away.
- isInitialPublish fires exactly once across rerenders.
- isImmediate does not double-fire at the trailing edge.

debounce:
- flush forwards the last pending arguments.
- a fresh debounce window works after clear().

41 tests pass (was 28), 100% branch coverage, lint + build + e2e green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(debounce): make "fresh window after clear" actually gate clear()

Review caught the original test as tautological: it passed even if
clear() were a no-op (the uncleared timer still fires once at t=100).
Restructured to assert nothing fires after clear() (proving cancellation)
and then that a fresh call fires once. Mutation-checked: the test now
fails when clear() is stubbed to a no-op.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

12 of 12 branches covered (100.0%)

Branch coverage included in aggregate %.

67 of 67 relevant lines covered (100.0%)

18.48 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28107688098.1 24 Jun 2026 02:56PM UTC 3
100.0
GitHub Action Run
Source Files on build 28107688098
  • Tree
  • List 3
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28107688098
  • 7aaf2888 on github
  • Prev Build on main (#28107216391)
  • Next Build on main (#28108114751)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc