File tree 2 files changed +16
-16
lines changed
2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ module.exports = function() {
7
7
if ( ! this . isRoot ( )
8
8
&& this . rule . required
9
9
&& ( ! this . source . hasOwnProperty ( this . field )
10
- || this . value === undefined || this . value === null ) ) {
10
+ || this . value === undefined ) ) {
11
11
this . raise (
12
12
this . reasons . required ,
13
13
this . messages . required , this . field ) ;
Original file line number Diff line number Diff line change @@ -19,21 +19,21 @@ describe('async-validate:', function() {
19
19
} ) ;
20
20
} ) ;
21
21
22
- it ( 'should error on required string field (null)' , function ( done ) {
23
- var descriptor = {
24
- type : 'object' ,
25
- fields : {
26
- name : { type : 'string' , required : true }
27
- }
28
- }
29
- var schema = new Schema ( descriptor ) ;
30
- schema . validate ( { name : null } , function ( err , res ) {
31
- expect ( res . errors . length ) . to . eql ( 2 ) ;
32
- expect ( res . fields . name . length ) . to . eql ( 2 ) ;
33
- expect ( res . errors [ 0 ] . message ) . to . eql ( 'name is required' ) ;
34
- done ( ) ;
35
- } ) ;
36
- } ) ;
22
+ // it('should error on required string field (null)', function(done) {
23
+ // var descriptor = {
24
+ // type: 'object',
25
+ // fields: {
26
+ // name: {type: 'string', required: true}
27
+ // }
28
+ // }
29
+ // var schema = new Schema(descriptor);
30
+ // schema.validate({name: null}, function(err, res) {
31
+ // expect(res.errors.length).to.eql(2);
32
+ // expect(res.fields.name.length).to.eql(2);
33
+ // expect(res.errors[0].message).to.eql('name is required');
34
+ // done();
35
+ // });
36
+ // });
37
37
38
38
it ( 'should error on non-string type' , function ( done ) {
39
39
var descriptor = {
You can’t perform that action at this time.
0 commit comments