Jest snapshot serializer for JSON REST API responses. As of v1.1.2, this package allows you to snapshot HTTP response objects that match a `{ status, body }` structure, generating JSON Schema snapshots instead of raw JSON. This is useful for API testing with libraries like `supertest` or `light-my-request`. The serializer produces schema-based snapshots that are more resilient to data changes. The package is stable but has a narrow scope. It is maintained primarily via community updates, with no active major development.
npm install jest-snapshots-json-rest-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using the serializer with supertest to generate JSON Schema snapshots for a REST endpoint.
Ensure your tests check specific values separately from snapshot matching, or use classic Jest snapshots for exact matches.
Ensure your response object (e.g., supertest response) has the shape `{ status, body }`.Consider using Jest's built-in snapshot functionality or custom serializers if updates are needed.
Run `yarn add --dev jest-snapshots-json-rest-api` or `npm install --save-dev jest-snapshots-json-rest-api`.
Make sure you call `expect.addSnapshotSerializer(serializer)` inside a test file or setup file. The serializer should be the default export from the package.
Check that the response object has `status` and `body` properties. Alternatively, update the snapshot with `--updateSnapshot`.
No dependency data recorded yet.