I am trying to add jest-json-schema to my Jest tests. In the Readme file they state that: *In any test file:
import { matchers } from 'jest-json-schema';
expect.extend(matchers);
Or if you want it available for all test files then set it up the same way in a test framework script file*
But I don't understand how to do it. Following docs in the jest documentation I created a file jest.config.js with
module.exports = async () => {
return {
verbose: true,
};
};
But cannot figure out how to actually combine the import and expect.extend(matchers) with the jest.config.js file. I'm getting errors like Unresolved function or method extend() when trying to return it within the block.