Does nodeunit have helper methods that I can place inside exports.MYTEST?
I am currently doing something like that:
exports.test = {
setup: function(test) {
this.foo = "bar";
},
helper: function(test) {
that.foo = 'baz';
},
myTest: function(test) {
that.helper(test);
}
};
var that = exports.test;
I know I am abusing javascript but currently this works pretty well.
Before everyone gets all worked up about how unit testing shouldn't involve something like that, I just want to do this because I find it pretty helpful to have helper methods that exist inside this object.
I would say functions are better for this kind of behaviour