jest-awsapigw-schema

1.0.2 • Public • Published

AWS OpenAPI Jest Extension

Shameless fork of jest-openapi from: https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/jest-openapi#readme

It uses AJV and draft-4 of openAPI to limit the spec to only elements supported by AWS.

This is very much a BETA wrapper before I start adding more of the AWS rules.

Usage

import jestAWSOpenAPI from 'jest-awsapigw-schema'
jestAWSOpenAPI(pathToAPISpec)

then in your tests:

expect(data).toMatchModel(ModelName) where data is your Request/Response object, and ModelName is the name of your schema in the OpenAPI file

or

expect(data).not.toMatchModel(ModelName) if you want to do negative tests.

Contributing

Please submit your PRs; all welcome!.

Readme

Keywords

none

Package Sidebar

Install

npm i jest-awsapigw-schema

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

23.1 kB

Total Files

24

Last publish

Collaborators

  • andylockran