freewil/express-form — pull request #19 by daxsorbito (2014-09-25 07:21:07+00:00)
Title: Option to validate the error always on non-required fields from custom validation

Added a new property to the fields object so that you could always validate the error thrown the custom validation by non-required fields.

Added a test also to validate it:
``` javascript
"field : validateErrorsAlways : custom not required with error" : function() {
var request = {
body: {
field0: "",
}
};
var helpers = {
customHelperWithError: function(data){
throw new Error('fail');
}
};
form(
field("field0").custom(helpers.customHelperWithError).validateErrorsAlways()
)(request, {});
assert.equal(request.form.isValid, false);
assert.equal(request.form.errors.length, 1);
}
```