Skip to content

Clarify what "unique customSnapshotIdentifier" means when using with jest.retryTimes() #348

Open
@mihkeleidast

Description

@mihkeleidast

When using jest.retryTimes, toMatchImageSnapshot fails if there is no custom customSnapshotIdentifier configured. However, I don't really understand what the docs mean in this case in terms of "uniqueness".

For example, if I define it like this:

customSnapshotIdentifier: (options) => {
    return `${options.defaultIdentifier}-snap`;
}

which is effectively the same as the default snapshot identifier, I get past the thrown error, and it seems to work OK. So why does it need to be configured at all?

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