jest-awsapigw-schema
v1.0.2
Published
Shameless fork of jest-openapi from: https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/jest-openapi#readme
Downloads
4
Readme
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!.