Piping message through should syntax, better Throws verbosity #96
Conversation
'cause we actually want to know what was thrown.
(tests passing in Chrome 21.0.1180.89 and Firefox 15. Safari 6.0 (7536.25) passes all tests except for the three includeStack tests.
Can you give some examples of what this would look like? (E.g. so we could include them in the docs.) Also, any reason not to add it to I just got approached at NodeConf summer camp about what I think is the same feature. He said "it's the one thing missing from Chai" that he got in should.js. So, +1 |
This comment has been minimized.
This comment has been minimized.
Style changes:
|
The other issue I see is that if your using the expect interface you can do the following... expect(14, 'msg').to.be.a('number', 'anthrmsg'); ...in which case the original |
It actually works for Expect, based on where I made the changes. Just added a commit including this new behavior in the Expect tests. Example: expect(temp).to.be.within(70, 80, 'comfortable temperature');
temp.should.be.within(70, 80, 'comfortable temperature'); On failure, the error message would be: "comfortable temperature: expected 60 to be within 70..80" |
I've been writing too much coffeescript!
Thanks. I also added a bit of documentation to the inline comments. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Found myself having difficulties with 'expected 5 to equal 3' or 'expected true to equal false' messages, I thought I'd make it easier to give myself debugging hints later.
Also, I want to know what happened when an unexpected exception is thrown, so I made it give me more detail.
Also of note: