I have found that if I configure jest-image-snapshot using a very similar configuration as shown in the examples, I get the following error when my tests run:
TypeError: Cannot read properties of undefined (reading '_counters')
at Object.toMatchImageSnapshot (node_modules/jest-image-snapshot/src/index.js:208:67)
The only way I can find to fix this is to add expect.extend({ toMatchImageSnapshot }); in my beforeAll section of my tests.
I have attached my config files in case it's of use.
tsconfig.json
tsconfig.node.json
tsconfig.tests.json
jest.setup.ts
jest.config.ts
Any ideas as to what I'm doing wrong here? It seems like something is getting in the way in between jest setup and the actual test executing.