Closed aseemk closed 11 years ago
Funny, for some reason it includes all my old commits for should.exist()
even though you already pulled those in. Any idea why that happens?
Note that this pull request includes all of the changes in pull request #14. That now includes the automatic error message support:
someAsyncTask(function (err, result) {
should.not.exist(err); // if this fails, uses err as the message
// ...
});
This patch adds an optional
msg
arg to all assertion methods:Because this wasn't possible for testing that properties exist:
I added a new verb called
expose
which is likeproperty
but doesn't take an optional value:Hat tip to @dominictarr for pointing this out.
This isn't possible for non-method assertions like
ok
andarguments
, which is why I'd love to change those to methods as well. Haven't figured out a clean way to do that without breaking existing code or having the change be opt-in via a config, which is kinda lame. What are your thoughts on that?I also improved the static
should.fail()
--- which was just a wrapper for the nativeassert.fail()
--- to actually set the passed-in message to the error'smessage
property.Other than that, some minor code and test cleanup. Let me know if something isn't clear.
Cheers, Aseem