You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

19 lines
510 B

/* global postman */
import Ajv from '../ajv.js';
const Extend = Symbol.for('extend');
Object.assign(postman[Extend], {
jsonSchema(store, schema, options) {
const ajv = new Ajv(options);
const validate = ajv.compile(schema);
store.test.push(response => validate(store.response.body.json));
},
jsonSchemaNot(store, schema, options) {
const ajv = new Ajv(options);
const validate = ajv.compile(schema);
store.test.push(response => !validate(store.response.body.json));
},
});