Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Piping message through should syntax, better Throws verbosity #96
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:
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
It actually works for Expect, based on where I made the changes. Just added a commit including this new behavior in the Expect tests.
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"