power-assert icon indicating copy to clipboard operation
power-assert copied to clipboard

Levenstein distance in descriptive assertion message

Open yamsellem opened this issue 8 years ago • 1 comments

When two strings of characters are very different, the output displayed by power assert is confusing.

May be using a Levenstein distance (or other) to display the first string entirely in red and the second entirely in green can help if they differ too much from each other?

capture d ecran 2017-10-19 a 15 22 50

This output is more confusing than helping, IMO. Thanks.

yamsellem avatar Oct 19 '17 13:10 yamsellem

@yamsellem Thanks. However, power-assert does not provide colored diffs so it must be a reporter output of testing framework you are using (Mocha, Jest, AVA, ...). So it's better to report the same issue there.

BTW using Levenstein distance to calculate string similarities is good idea and I'm interested in it.

twada avatar Oct 20 '17 06:10 twada