-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
No showDiff set on assert interface #515
Comments
Hey @timruffles thanks for the issue. I assume you are saying that at one point you didn't need to pass in However (if Im right in what you're saying), I do agree that passing Thanks 😄 |
To summarise what should change, rather than L101 currently being: if (true !== showDiff) showDiff = false; It should be changed to if (false !== showDiff) showDiff = true;
if (undefined === expected && undefined === _actual) showDiff = false; And you'll need to add tests reflecting this change - in the chai/test/assert.js file |
Hi @keithamus, would you mind taking a look at what I've thought could be done to test this? it.only('passing exp and act makes showDiff be true', function() {
try {
assert.equal('one', 'two');
} catch(e) {
assert.isTrue(e.showDiff);
}
}); Unfortunately this works on node but it doesn't on karma. I have no idea why this happens, apparently this should work correctly on both platforms. |
Well, I'm about to surrender, @keithamus, I have no idea why my tests work on Node but don't on Karma. The only change I've made was the one you suggested and my test is as I described on the comment above. On node everything runs fine, but on karma the test called Is there a difference between node and browsers that could make this happen? |
Hi, I've tried to reproduce what you describe, and I see quite a different picture. What I see is this:
That is: the node is visiting assert twice .. which is not surprising since we have two assertions in:
When using karma:
So, again, we have two separate assertions reported. I've noticed a problem with Makefile though: |
Thank you, @qbolec! What I've described before was probably happening because Karma was using the old chai.js file (the one at the repositories' root) for the test (as described above by @qbolec). EDIT: I've just seen this is written into the file that talks about contributions, sorry for not paying enough attention to it 😢 |
IMHO, the fact that
which should instead read:
I'm not sure how to tell make to search at arbitrary depth - the accepted solution to http://stackoverflow.com/questions/4036191/sources-from-subdirectories-in-makefile seems to not work on my version of make 4.1, that is $(wildcard lib/*/.js) matches only two files lib/chai/config.js lib/chai/assertion.js so I guess that double asterix does not really do what one assumes. Perhaps this is an issue with Windows. |
@qbolec you're totally right on that. Our build scripts are not doing a good enough job. Feel free to PR a change of the |
Hello everyone, Thanks for the help! |
👍 |
Just wondering why? Happy to PR this in. It's a bit of a shame this behaviour magically stopped working.
e.g
The text was updated successfully, but these errors were encountered: