deno_std
deno_std copied to clipboard
restore background highlight in diff of assertEquals
We temporarily disabled background highlight in diff of assertEquals (#2601) as it's very hard to see in certain terminals
We used to use bgGreen
and white
combination for that highlight. It's enough visible in some terminals, but it's not in some others. (See #2575 for example)
One solution might be to use true color
coloring when the terminal supports it, and fallback to ansi color when no support of it
Note: supports-color npm module seems doing this detection
So I could only check if the terminal supports true color and if it does I can color it with bgGreen and white and if it doesn't leave it uncolored?
The issue happens on some terminals with ansi colors (green
, bgGreen
, etc). To avoid that if the terminal supports true color
then we should use color code (like 006400
for green, for example), and if it doesn't, we fallback to ansi colors (green, bgGreen, etc)
I'll take a stab at this one then. I'll be trying to open a PR next weekend
This becomes trivial when https://github.com/denoland/deno/pull/18549 lands.