v1.0.0
OASprey v1.0.0
Initial release of OASprey - Jest matchers for testing OpenAPI specifications.
This is a hard fork of OpenAPIValidators, modernized with updated dependencies and focused solely on Jest support.
Features
- Jest matchers for validating API responses against OpenAPI specifications
toSatisfyApiSpec()matcher for validating HTTP responsestoSatisfySchemaInApiSpec()matcher for validating objects against schemas- Support for OpenAPI 3.0 specifications
- Support for loading specs from files, objects, or web endpoints
- Full TypeScript support
Installation
npm install --save-dev oaspreyQuick Start
import { loadSpec } from 'oasprey';
loadSpec('path/to/openapi.yml');
test('API response matches spec', async () => {
const res = await axios.get('/api/endpoint');
expect(res).toSatisfyApiSpec();
});