{"library":"jest-openapi","type":"library","category":null,"description":"jest-openapi is a Jest plugin that significantly enhances the standard Jest assertion capabilities by providing specialized matchers for validating API responses and data objects against an OpenAPI specification (supporting both v2 and v3). Its core purpose is to automate the verification that a server's actual runtime behavior precisely matches its documented API contract. The current stable version, 0.14.2, was last updated in January 2022, having seen several iterative improvements and fixes throughout 2021, indicating an actively maintained project with a practical, feature-driven release cadence. This library is indispensable for ensuring contract consistency and preventing silent discrepancies between backend service implementations and their public-facing documentation, thereby reducing integration issues for consuming clients. It stands out by offering broad compatibility with responses from various popular HTTP client libraries, including axios, request-promise, supertest, and superagent. Furthermore, it effortlessly processes OpenAPI specifications provided in either YAML or JSON formats, intelligently resolves $ref declarations within the spec, and delivers clear, diagnostic error messages when validation failures occur. For development teams utilizing testing frameworks that are built around Chai, a companion package, chai-openapi-response-validator, offers an equivalent set of validation utilities.","language":"javascript","status":"active","version":"0.14.2","tags":["javascript","jest","openapi","testing","response","validate","assertions","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install jest-openapi","imports":["import jestOpenAPI from 'jest-openapi';","const jestOpenAPI = require('jest-openapi').default;","expect(response).toSatisfyApiSpec();"]},{"cmd":"yarn add jest-openapi","imports":[]},{"cmd":"pnpm add jest-openapi","imports":[]}],"homepage":null,"github":"https://github.com/openapi-library/OpenAPIValidators","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/jest-openapi","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/jest-openapi/compatibility"}}