Hello,
I wrote a mini test and put it the existing tests directory:
var Validator = require('../src/validator.js');
var Assert = Validator.Assert;
Validator.Validator().validate( 'foo', new Assert().Length( { min: 4 } ) );
Validator.Validator().validate( 'foo', [ new Assert().Length( { min: 4 } ), new Assert().Email() ] );
node throws exception:
Validator.Validator().validate( 'foo', new Assert().Length( { min: 4 } ) );
^
TypeError: Cannot call method 'validate' of undefined
at Object. (/Users/Mahdi/Desktop/tmp/node_modules/validator.js/tests/temp.js:4:23)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Hello,
I wrote a mini test and put it the existing tests directory:
var Validator = require('../src/validator.js');
var Assert = Validator.Assert;
Validator.Validator().validate( 'foo', new Assert().Length( { min: 4 } ) );
Validator.Validator().validate( 'foo', [ new Assert().Length( { min: 4 } ), new Assert().Email() ] );
node throws exception:
Validator.Validator().validate( 'foo', new Assert().Length( { min: 4 } ) );
^
TypeError: Cannot call method 'validate' of undefined
at Object. (/Users/Mahdi/Desktop/tmp/node_modules/validator.js/tests/temp.js:4:23)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3