Skip to content

Undefined #20

@Moondee

Description

@Moondee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions