Axios-VCR is a set of middlewares for the Axios HTTP client that enables recording and replaying of HTTP requests for testing purposes. Current stable version is 1.0.2, released in 2017, with no active development. It writes request/response pairs to JSON cassette files, allowing deterministic and fast tests by avoiding real network calls. Unlike tools like nock or Polly.js, it integrates directly with Axios via middleware, but lacks cassette expiration, Mocha integration, and support for non-global Axios instances. Release cadence is stalled, making it suitable only for simple, legacy projects.
npm install axios-vcrNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Records and replays a GET request using a JSON cassette file.
Delete or update the cassette file manually when you need fresh responses.
Use the default axios instance or merge interceptors manually.
Consider alternatives like nock, Polly.js, or msw.
Ensure cassette files are created by the library initially, not manually.
Use promise chaining or async/await to ensure eject runs after all requests.
Run 'npm install --save-dev axios-vcr'
Ensure you use 'const axiosVCR = require('axios-vcr')' (CommonJS)Install axios: 'npm install axios'
Create the directory or use an absolute path