Skip to content
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

Added asserts from Christian Johansen's Test-Driven Javascript Development book #153

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

godsflaw
Copy link

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.

@godsflaw
Copy link
Author

looks like test.notEquals() from the book also does not work. One must use test.notEqual() instead. Still does not change pull request.

@godsflaw
Copy link
Author

godsflaw commented Jun 2, 2012

bump

Added assert for isBuffer using the Buffer.isBuffer check.  Also merged up
to current master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant