mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
Separate the tests with comments
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user