Skip to main content
Tusk Drift is an API test automation tool that helps developers detect regressions. We record and replay live traffic to provide a full API test suite with zero engineering effort. Unlike traditional mocking libraries, which make it difficult to set up idempotent tests, engineering teams using Tusk Drift can get a full API test suite of over 200 realistic tests within 10 minutes of initializing our SDK.

How It Works

  1. Record: Captures traces from live traffic
  2. Replay: Runs traces as API tests with mocked responses
  3. Detect: Surfaces regressions by comparing actual vs. expected output

Record

Our SDK instruments your Node service, similar to OpenTelemetry. It captures all inbound and outbound requests like database queries, HTTP requests, and auth token generation. As seen in the diagram below, Tusk records all requests and responses at the edges of the service it is enabled on (the dashed border): Tusk Drift diagram of data flow in light mode

Replay

You can run the traces as tests using the Tusk Drift CLI. This replays the inbound API call while intercepting outbound requests and serving them from recorded data. In the example diagram above, the inbound API call is GET /api/post/1 and the outbound requests are the SQL query and GET /ext-service/post/post-ext-id-1. Drift’s tests are therefore idempotent, side-effect free, and fast (typically under 100 ms per test). Think of it as a unit test but for your API. Demo of Tusk Drift CLI replaying tests

Detect

Our Cloud platform looks at the diff between the expected and actual output, correlates it to the PR’s changes, and then classifies if the deviation is intended or unintended. Example API Drift Run page in dark mode Our AI functionalities do the following automatically:
  • Updates the test suite of recorded traces to maintain freshness
  • Matches relevant Drift tests to your PR’s changes when running tests in CI
  • Surfaces unintended deviations (i.e., regressions), does root cause analysis, and suggests code fixes