axios-mock-adapter

JSON →
library 2.1.0 ·javascript
verified Jun 7, 2026

axios-mock-adapter is a lightweight mocking library for Axios that allows you to easily mock HTTP requests in tests by intercepting Axios calls and returning custom responses. v2.1.0 supports Axios >= 0.17.0 and works in both Node.js and browser environments. It provides a simple API for mocking requests by method, URL, parameters, and regex, with support for replyOnce, delays, network errors, and timeouts. Unlike nock or msw, it directly replaces the Axios adapter without requiring server setup, making it ideal for unit tests.