jestjs/jest

Zero width chars not showing in diff

Open

#10,584 建立於 2020年10月4日

在 GitHub 查看
 (12 留言) (0 反應) (0 負責人)TypeScript (45,361 star) (6,653 fork)batch import
:rocket: Feature RequestHelp WantedPinned

描述

🐛 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 

貢獻者指南