Separate the tests with comments

This commit is contained in:
Matías Olivera
2019-01-06 17:40:38 -03:00
parent 1e6edecd00
commit d79a32cd8c
+12 -1
View File
@@ -62,7 +62,10 @@ var data: any = {
foo: 'bar'
};
var validator: Validator.Validator<any> = new Validator(data, rules);
/**
* Passing validation
*/
var passes: boolean = validator.passes() as boolean;
validator.passes(() => {});
@@ -72,12 +75,20 @@ validator.fails(() => {});
var check: boolean = validator.check();
/**
* Validation errors
*/
var errors: Validator.Errors = validator.errors;
var all: Validator.ValidationErrors = errors.all();
var error: Array<string> = errors.get('foo');
var first: string | boolean = errors.first('foo');
var has: boolean = errors.has('foo');
/**
* Validator
*/
Validator.setMessages('en', {
integer: 'The :attribute must be an integer.',
min: {