Thanks for the work that you've been doing with this lib. I'm testing out a couple of OAS validator libs to integrate with our Cypress tests and I'm having some troubles integrating yours with Cypress 13.5.0 - was wondering if you can help out.
import {expect, use} from "chai";
const {SwaggerValidation} = require('@jc21/cypress-swagger-validation');
export default defineConfig({
screenshotOnRunFailure: false,
env: {
hideCredentials: true,
},
e2e: {
baseUrl: 'https://api.stg.thousandeyes.com',
setupNodeEvents(on, config) {
on('task', {
SwaggerValidation(config){
return config;
},
otherTask(){}
describe('API Test', () => {
it.only('should satisfy OpenAPI spec', () => {
MyEndpoint.getAll().then((response) => {
const config = {
file: 'path.to.yaml.file',
endpoint: '/v7/account-groups',
method: 'GET',
statusCode: 200,
responseSchema: response.body,
verbose: true,
}
// cy.task('validateSwaggerSchema', config).should('equal', null);
SwaggerValidation(config).validateSwaggerSchema(config)
});
});
});