-
Notifications
You must be signed in to change notification settings - Fork 107
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
[feature request] [discussion] Addings support for walaby.js #67
Comments
I am pretty sure this is already taken care of by Sinon-Chai, which includes See also chaijs/chai#469. Tagging in @keithamus in case I got this wrong. |
Actually I'm pretty sure this is sinon-chai's issue. Firstly, there is a So
Sinon-chai isn't passing in A quick test in the REPL proves as much: > var error; try { chai.expect(sinon.spy()).to.be.called } catch(e) { error = e };
> error.expected
undefined
> error.actual
> error.actual.toString()
'spy' |
Ah excellent, good catch and I'm glad I tagged you in :). PR welcome if someone can figure this out, or I can try to make time for it. Although I have no idea what the actual/expected would be for an example like .to.be.called. I guess the args-comparison ones are the most straightforward. |
|
|
We shouldn't need to go that far. We can present the given args and actual args (as whole objects), and the test-runners diffing engine will handle the rest. |
OK, this should be implemented by |
If wallaby.js supports chai diffs properly, then they need to do nothing else. Sinon-chai needs to pass in |
Is it? Correct me me if I'm wrong, but if Sinon-chai will only be fixed to pass
Mocha checks if an assertion error nas So if an assertion error has It seems more semantically valid to me that when some assertion framework throws an AssertionError and doesn't set Could you please elaborate a bit on why you reckon "engines should only check if the flag is explicitly false"? Chai actually enforces the logic that I think is correct by setting |
My understanding is that If you're only showing diffs when > var error; try { assert.ok(false) } catch(e) { error = e; }
{ [AssertionError: false == true]
name: 'AssertionError',
actual: false,
expected: true,
operator: '==',
message: 'false == true',
generatedMessage: true }
> error.showDiff === true
false
> 'showDiff' in error
false But actually, you're right. It was a mistake to call So ultimately, the change is that sinon-chai needs to change L95 to include the 4th, 5th and 6th arguments, being |
You are right. Some assertions libraries, such as node's assert, don't set it, some do set it. One of the other reasons why I have decided to check For example in the case of node's assertion functions, there's really only one of them where calculating diffs makes sense in my opinion, it's |
I am still waiting for feature How can I visually compare
it not very easy to compare per hand this 2 JSON outputs |
sinon-chai
should setshowDiff
flag forAssertionError
to make available to show the diff inwalaby.js
for.See also walaby.js issue
The text was updated successfully, but these errors were encountered: