Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Levenstein distance in descriptive assertion message #99

Open
yamsellem opened this issue Oct 19, 2017 · 1 comment
Open

Levenstein distance in descriptive assertion message #99

yamsellem opened this issue Oct 19, 2017 · 1 comment

Comments

@yamsellem
Copy link

yamsellem commented Oct 19, 2017

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.

@twada
Copy link
Member

twada commented Oct 20, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants