feat(redis): add channel prefix and error handling

This commit is contained in:
2026-05-08 06:33:15 +00:00
parent 7c12b40ed2
commit 392682c7be
6 changed files with 258 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
---
id: core-pubsub-tests
name: Write tests for createPubSub, EventEnvelope, and in-process event target
status: pending
status: completed
depends_on: []
scope: moderate
risk: low
@@ -43,8 +43,11 @@ The architecture specifies these behaviors:
## Notes
> To be filled by implementation agent
Used subscribe-based testing approach since `createPubSub` doesn't expose the internal `target`. Custom eventTarget tests use `vi.spyOn` on the provided target's `dispatchEvent` method.
## Summary
> To be filled on completion
Implemented comprehensive tests for createPubSub, EventEnvelope, and in-process event target.
- Created: test/create_pubsub.test.ts
- Tests: 11, all passing
- Coverage: publish dispatches correct type:id topic, publish throws on __-prefixed types, subscribe yields EventEnvelope objects, envelope has correct type/id/payload, topic scoping (type:id matching), multiple subscribers receive events, subscriber cleanup on break, custom eventTarget dispatches to provided target, default in-process EventTarget works