Added asserts from Christian Johansen's Test-Driven Javascript Development book #153
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Chapter 14 covers unit testing in node using a forked version of nodeunit from a few years ago. Since I want to use the latest version of nodeunit in my tests, but find the additional asserts from Christian's book helpful, I thought it would be useful if I made an attempt at including them.
Now, Christian has a side project named node-assert-extras, but I couldn't easily see how to get that to play well with the nodeunit assert.js. Instead, I just included a bunch of his assert additions into nodeunit assert.js.
I'm almost done reading chapter 14 and have only found one difference: he maps test.noException and variation to test.doesNotThrow. I saw no need to add these additional mappings.
In short, this pull request does 99% of the work one needs to do in order to allow people using Christian's book to simply use the latest version of nodeunit. Not to mention, it adds some very nice additional asserts. I was hoping that someone would have already done the work to port those changes in, and indeed perhaps someone has but the pull request was rejected for some reason. I am willing to do the legwork to get this into the mainline, so please let me know if you want me to do something.