19 tasks covering core testing, Redis hardening, WebSocket client/server adapters, Worker adapter, and final review gates. Iroh adapters are tracked as a deferred placeholder blocked on the @alkdev/iroh fork. Phases: core validation → Redis hardening → review gate → WebSocket adapters → review gate → Worker adapter → review gate → final validation.
1.6 KiB
1.6 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|
| worker-adapter-tests | Write tests for Worker event target adapter | pending |
|
moderate | medium | component | implementation |
Description
Write tests for the Worker event target adapter(s). Testing Workers is non-trivial because it requires creating actual Worker instances or mocking the postMessage/onmessage API.
Test scenarios from the architecture doc:
- Main → Worker send — dispatchEvent from main posts message to worker
- Worker → Main send — dispatchEvent from worker posts message to main
- Bidirectional — both sides can subscribe and publish
- Topic scoping — type:id topics correctly formed
- Envelope round-trip — full envelope survives serialization
- Worker termination — cleanup when worker exits
Acceptance Criteria
test/event-target-worker.test.tsexists and passes- Mock strategy for Worker environment established (actual workers, vitest worker threads, or mocked postMessage)
- Test: host dispatchEvent posts message to worker via postMessage
- Test: worker thread dispatchEvent posts message to parent
- Test: bidirectional communication works
- Test: type:id topic scoping works correctly
- Test: EventEnvelope round-trips through serialization
- Test: addEventListener and removeEventListener work on both sides
References
- docs/architecture/event-targets/worker.md (Test Plan section)
- src/event-target-worker.ts
Notes
To be filled by implementation agent
Summary
To be filled on completion