A Jest snapshot serializer for Axios HTTP responses, enabling snapshot testing of HTTP response bodies and headers. Version 1.0.1 is the current stable release, with TypeScript types included. It serializes Axios response objects into a readable HTTP format, stripping the Date header by default but allowing custom transformers via setResponseTransformer. Differentiator: integrates seamlessly with Jest snapshot testing for Axios responses, supporting inline snapshots and custom header filtering. Built for use with axios-test-instance for testing Express/Koa apps.
npm install jest-axios-snapshotNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure Jest to use the serializer and snapshot test an Axios response.
import { setResponseTransformer } from 'jest-axios-snapshot';
setResponseTransformer(response => response);Ensure you pass the entire Axios response object, not just response.data.
Update Node.js to version 12 or higher.
Run npm install jest-axios-snapshot --save-dev and ensure it's listed in package.json.
Ensure the config has snapshotSerializers: ['jest-axios-snapshot'] (string).
Add 'jest-axios-snapshot' to snapshotSerializers in Jest config.
No dependency data recorded yet.