4
각 테스트에 전달 된 NodeUnit test
객체에 사용자 정의 어설 션을 추가하는 방법이 있습니까?NodeUnit에 사용자 정의 어설 션을 추가하는 방법
내가 할 싶습니다 뭔가 같은 :
var Test = require('nodeunit').Test;
Test.prototype.customAssertion = function(obj) {
test.same(obj.foo, 'bar');
test.same(obj.bar, 'baz');
}
exports.test = function(test) {
test.customAssertion(obj);
test.done();
}