Skip to content

constructor should throw an error if defaultsTo is a function returning null and null doesn't pass the validator #22

Closed
semmypurewal opened this Issue Oct 25, 2012 · 1 comment

1 participant

@semmypurewal
Owner

This test fails:

it("should throw an error if the defaultValue is a function that returns null and null doesn't  pass the validator", function   () {
        var Person = new Model(function () {
            this.hasA("name").which.validatesWith(function (name) {
                return typeof(name) === "string";
            });
        });

        expect(function () {
            p = new Person();
    }).toThrow();
});
@semmypurewal
Owner

This test appears to be passing after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.