Skip to content

v1.0.0

Choose a tag to compare

@dacharyc dacharyc released this 12 Dec 17:06
· 11 commits to main since this release

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 responses
  • toSatisfySchemaInApiSpec() 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 oasprey

Quick 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();
});