Skip to content

Add invisible characters highlighting in diffs #2673

@knowbody

Description

@knowbody

feature request

What is the current behavior?

Currently the diffs don't check for invisible characters like spaces. I spent a bit of time debugging an invariant error check. And my tests weren't passing because I was leaving a space before the new line character. In the end I used .toThrowErrorMatchingSnapshot() and copy pasting that to my test case made the test pass and made me realise that I was adding that extra space before \n.

.toThrowError("There is no route defined for key Settings. \nMust be one of: 'Home'");

image

and passes fine when:

.toThrowError("There is no route defined for key Settings.\nMust be one of: 'Home'");

At the moment it's hard to guess, what it is, at first I thought that there was something wrong with how the quotes are being escaped, as that's what is shown in the diff.

What is the expected behavior?

It would be great if we could highlight these invisible characters in the diff.

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