Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { matchersWithOptions } from 'jest-json-schema';
expect.extend(
matchersWithOptions(
{
formats: {
test: /^test$/,
},
},
ajv => {
ajv.addKeyword('test', {
validate: (schema: any, data: string) => {
return schema && data === 'test';
},
metaSchema: {
type: 'boolean',
},
});
},
),
const { matchersWithOptions } = require('jest-json-schema');
expect.extend(matchersWithOptions({ allErrors: true }));