Skip to content

[Feature]: jest-diff should allow configuring sorting of object keys #11938

@vjpr

Description

@vjpr

🚀 Feature Proposal

Allow configuring the object key sorting for jest-diff. At present it sorts alphabetically. It should allow using the existing sorting, or providing a function to sort before visual diff is generated.

Motivation

I am trying to diff two package.json files, and it keys are being sorted alphabetically when displaying the diff. This makes it hard to eyeball, because keys are not where you think they will be.

Example

No response

Pitch

There is no way around it with the way jest-diff is designed.

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