testing library

Test doubles for driving TON Connect without a network or a wallet.

Import this in tests only. It lets a dApp exercise its own connect, send and disconnect flows against a scripted wallet, including the paths that are awkward to reach for real — a declined transaction, a wallet that hangs up, a bridge that drops the connection.

Classes

FakeInjectedBridge
An InjectedBridge the test drives directly.
FakeSseTransport
An SseTransport that hands the test direct control of each connection.
FakeWallet
Stands in for the wallet side of a session.