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

Add improved diffing for calledWith #104

Merged
merged 1 commit into from
Jul 18, 2017
Merged

Conversation

@BuiltByWalsh BuiltByWalsh changed the title Add improved diffing for calledWith (#93) Add improved diffing for calledWith Jul 17, 2017
@BuiltByWalsh
Copy link
Contributor Author

Ideally I would have like to remove the %* on lines 142, 143, and 144. Seems like overkill when using %D. But testing for that seemed to be non-trivial.

@BuiltByWalsh
Copy link
Contributor Author

Looks like build job 13 is failing with Error: Cannot find module 'lodash'. I suspect some flakiness in Travis. All other builds with those versions of sinon and chai seem to pass. Going to proceed with closing and reopening to see what happens.

@domenic
Copy link
Collaborator

domenic commented Jul 18, 2017

Looks good. I do think it would be nice to match %*, but that then gets tricky not only with testing but also with the negated versions. So this will be the easiest thing for now. We'll see if anyone complains.

@domenic domenic merged commit 48d2408 into chaijs:master Jul 18, 2017
@harmon
Copy link

harmon commented Oct 25, 2017

Thank god for this PR! Sooo much easier to diff large object changes. Thanks! Saves me lots of time.

cincodenada added a commit to cincodenada/sinon-chai that referenced this pull request Nov 1, 2021
This is a continuation in the spirit of chaijs#104, but resolves the
awkwardness with the negative version, and brings us closer to core
Sinon messages.

To do this, we changed the nonNegatedSuffix parameter to instead take a
pair of suffixes, nonNegated and negated.  This allows us to specify %D
for the nonNegated case, which eliminates noisy duplication, while still
using %*%C for the negated case. This also matches what core Sinon
outputs in these cases.

As shorthand, we still support specifying a single value, which we
use for nonNegatedSuffix and assume an empty negatedSuffix.
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

Successfully merging this pull request may close these issues.

3 participants