Skip to content

feat: replay transport for deterministic testing - #491

Merged
Chuks-coderr merged 2 commits into
SoroStream:mainfrom
fridaypetra55-afk:feat/395-replay-transport
Aug 27, 2026
Merged

Chuks-coderr merged 2 commits into
SoroStream:mainfrom
fridaypetra55-afk:feat/395-replay-transport

Conversation

@fridaypetra55-afk

Copy link
Copy Markdown
Contributor

Summary

Add a replay transport that records all RPC interactions to a JSON fixture file and can replay them deterministically in tests, eliminating the need for live network calls in unit tests.

Changes

  • New src/replayTransport.ts:
    • ReplayTransport.record(baseTransport, path?, options?) – wraps any RpcTransportAdapter and logs every request/response pair; call save() to write JSON fixture to disk or toJSON() for in-memory access
    • ReplayTransport.replay(fixture) – serves pre-recorded responses deterministically with per-method FIFO queues; no live network calls made
    • ReplayTransport.parse(json) – parses a fixture JSON string into a FixtureFile
    • ReplayFixtureError / ReplayFixtureParseError error classes
    • BigInt values survive serialisation round-trips via { __bigint: "..." } sentinel
  • All symbols exported from src/index.ts
  • 25 unit tests in test/replay_transport.test.ts

Testing

  • 25 new tests pass
  • Full test suite passes (pre-existing failure in issue_409_412 is unrelated)
  • Lint/type check clean (pre-existing FinalizationRegistry errors in base codebase)

Closes #395

Add a replay transport that records all RPC interactions to a JSON
fixture file and can replay them deterministically in tests, eliminating
the need for live network calls in unit tests.

Closes SoroStream#395
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@fridaypetra55-afk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chuks-coderr
Chuks-coderr merged commit 2141048 into SoroStream:main Aug 27, 2026
1 check failed
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.

Implement SDK event replay mode for integration testing

2 participants