Those of you doing Node.js development may be interested in a new unit testing tool I recently released, called Testpilot. You can find it at http://github.com/capsela/testpilot or install it directly with `npm install testpilot`. It is a drop-in replacement for nodeunit (provided you don't depend on nodeunit's more esoteric features and reporters), but adds better support for promise-based code:
- assertion methods accept promises directly: you don't need to explicitly wait for them to resolve before asserting
- test methods can return promises to indicate test completion: no need to wait for a promise to resolve before calling test.done()
I also tried to improve on nodeunit in a few other ways unrelated to promises, and you can find more info on the Github page. At this point Testpilot is light on features but generally works well. If you like it but think it is missing something, then please help me prioritize further development by posting to the github issue tracker. Thank you for your interest, and I look forward to any feedback.
- Chris Osborn
exports['test foo'] = function (assert) {
return Q.call(function () {
// do some asyncness
})
.timeout(1000)
};
I will try to take a deeper look.
It looks like it hones pretty close to my spec. I would love feedback.
http://kriskowal.github.com/uncommonjs/tests/specification
Kris Kowal