-
Notifications
You must be signed in to change notification settings - Fork 11
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
Optionally ignore casing #1
Comments
@shinmen14 'DeSoto' weighs differently than 'Desoto' and even 'desoto' Basically, capital letters in javascript compare differently than lower case, so while it looks like 'DeSoto' should be after 'Dedoto' that is not the case unless we push them to the same case Take for instance,
#2 suggests changing the API a bit to allow for a more explicit usage. I could add something similar to What do you think? |
@shinmen14 due to response time, I'm going to assume the best compromise is for a feature enhancement allowing. If you have any further thoughts on the matter I'm more than happy to incorporate those as well. |
Came here looking for just this. I figured I would help out and open a PR to add this enhancement. |
why this isn't working? |
Hi,
It looks like the sorting check fails when a string has an upper case letter in the middle. For instance, the following scenario fails the check:
expect([{name: "Dedoto"}, {name: "DeSoto"}]).to.be.sortedBy('name');
If I change the S to s, it will work as expected:
expect([{name: "Dedoto"}, {name: "Desoto"}]).to.be.sortedBy('name');
I'm currently testing an endpoint that returns an array of US cities and the test case was failing because of that specific scenario. It turns out DeSoto is an actual city located in Texas.
Let me know if you need any additional information.
Thanks.
The text was updated successfully, but these errors were encountered: