jest-extended icon indicating copy to clipboard operation
jest-extended copied to clipboard

Feature Request: Array matcher diff

Open didley opened this issue 3 months ago • 0 comments

Feature Request

Description:

We have many tests dealing with large arrays, but it can be difficult to determine the reason for the failure with the current array matcher messages.

Would you be open to adding an additional diff section to the array failure messages. I'd be happy to create the PR implementing it.

Possible solution:

I'd imagine it'd be something like this.

    Expected list to have all of the following members:
      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, …]
    Received:
      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, …]
    Diff:
    Received is missing: [12, 14, 16]
    Received includes: [13, 15, 17]

didley avatar Apr 04 '24 11:04 didley