jestjs/jest

Zero width chars not showing in diff

Open

#10,584 opened on Oct 4, 2020

View on GitHub
 (12 comments) (0 reactions) (0 assignees)TypeScript (6,653 forks)batch import
:rocket: Feature RequestHelp WantedPinned

Repository metrics

Stars
 (45,361 stars)
PR merge metrics
 (Avg merge 11d 22h) (11 merged PRs in 30d)

Description

🐛 Bug Report

Differences in strings containing zero width chars are not highlighted, making them incredibly hard to spot and debug. Eg, one of the following strings has as its first character (character at position 0) a byte order mark character as its first character, and the other has the letter "T" as its first character.

image

Additional useful info

To Reproduce

Just create two strings that look identical, one of which contains a character such as the BOM character.

Expected behavior

A clear indication of the difference.

envinfo

  System:
    OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  Binaries:
    Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
    Yarn: 1.21.1 - /usr/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v14.4.0/bin/npm
  npmPackages:
    jest: ^26.0.1 => 26.0.1 

Contributor guide