Toxiproxy from Shopify lets you inject real network failures (latency, timeouts, connection resets, bandwidth limits) into a running Node.js backend to verify that TypeScript SDK retry logic, timeouts, and error recovery actually work. The guide walks through setting up an Express backend, configuring Toxiproxy with Docker Compose, writing an API client with timeout and exponential backoff, injecting various toxics via the REST API, and automating failure scenarios in a Vitest test suite.

4m read timeFrom typescript.tv
Post cover image
Table of contents
ContentsThe Happy Path TrapSetting Up the BackendAdding Toxiproxy with Docker ComposeWriting the API ClientInjecting ToxicsAutomating It in Tests

Sort: