Skip to content

Configuring jest-image-snapshot with jest and playwright issues #374

@cb-101-overstory

Description

@cb-101-overstory

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions