molnarg / js-schema

Simple and intuitive schema validator
http://molnarg.github.com/js-schema/
MIT License
388 stars 45 forks source link

unit test failure on "empty object should be valid sometimes" #38

Open acthp opened 9 years ago

acthp commented 9 years ago

Just tried running the unit tests on master branch, but it failed in validate-object.

vedmalex commented 9 years ago

+1

yes it break the my code after update... to latest version

var schema = require('js-schema');
var assert = require('assert');
v = schema({
    out: String,
    rest: [null, String]
});

var val = {
    out: "sometext"
};

console.log(v.errors(val)) //<< it is invalid.
assert(v(val)); // << false