1.0.2 • Published 3 years ago

jest-awsapigw-schema v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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!.