chai-openapi-response-validator
Version:
Use Chai to assert that HTTP responses satisfy an OpenAPI spec
20 lines • 1.09 kB
TypeScript
/// <reference types="chai" />
import { OpenAPISpecObject } from 'openapi-validator';
declare global {
namespace Chai {
interface Assertion {
/**
* Check the HTTP response object satisfies a response defined in your OpenAPI spec.
* [See usage example](https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/chai-openapi-response-validator#in-api-tests-validate-the-status-and-body-of-http-responses-against-your-openapi-spec)
*/
satisfyApiSpec: Assertion;
/**
* Check the object satisfies a schema defined in your OpenAPI spec.
* [See usage example](https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/chai-openapi-response-validator#in-unit-tests-validate-objects-against-schemas-defined-in-your-openapi-spec)
*/
satisfySchemaInApiSpec(schemaName: string): Assertion;
}
}
}
export default function (filepathOrObject: string | OpenAPISpecObject): Chai.ChaiPlugin;
//# sourceMappingURL=index.d.ts.map