Skip to content

When jest.fn() inside a enzyme ReactWrapper, snapshots get really large #107

@swashata

Description

@swashata

Yes I know that we should not snapshot test against something dynamic as jest.fn() and I swear 😇it was unintentional.

But I have found that when jest.fn() is passed as a prop to some component, the snapshot fails everytime (which is expected) but along with this, it generates some really really large snapshot files.

An example for reproducing this can be found here https://github.com/swashata/enzyme-to-json-bug

You can check the file https://github.com/swashata/enzyme-to-json-bug/blob/master/__snapshots__/Test.spec.jsx.snap which is like 7.6MB.

I guess this can be a enzyme-to-json thing?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions