@simply-openapi/jest-describe-openapi
v1.0.0
Published
Jest testing utilities for OpenAPI contracts.
Downloads
2
Readme
@simply-openapi/jest-describe-openapi
Automatic snapshot test generation from OpenAPI specification.
This library provides a series of functions that generate a multitude of individual jest tests for specific facets of OpenAPI specifications. By creating individual tests for each facet, errors are localized into descriptive tests that offer hints as to where the spec has changed. This is in contrast to snapshotting the spec as a whole, which can be difficult to spot snapshot changes in.
This library also takes care to avoid possible snapshot changes that can occur when things in the spec are reordered but otherwise identical. For example, the operation parameters array is not order sensitive, and so the snapshots will not fail if the array is reordered but the parameters remain unchanged.