js-schema icon indicating copy to clipboard operation
js-schema copied to clipboard

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

Open acthp opened this issue 9 years ago • 1 comments

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

acthp avatar May 16 '15 15:05 acthp

+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

vedmalex avatar Jun 01 '15 09:06 vedmalex