Skip to content

Improve the diff between expected/received on mock calls #5843

@gustavovnicius

Description

@gustavovnicius

The diff output of a mismatched spy/mock argument is not nice. It'd be good to make it look similar to how a "normal" diff (like when using .toBe) looks.

Here is a ridiculous example, trying to stress out the difference:
https://repl.it/@gustavovnicius/jest-diff

Saving you a click:

image
Nice diff

image
Nasty diff

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions