Hello again, just logging here a potential improvement of the error message for s.spec.number.
I have:
const school = s.spec.map("schoolSpec", {
city: s.string
});
const friend = s.spec.map("friendSpec", {
name: s.spec.string,
age: s.spec.number,
school
});
and (using the new js-spec-chai:
it("test", () => {
const obj = {
name: "andrea",
age: "18",
school: {
city: "Turin",
}
};
obj.should.conform(friend);
})
I receive AssertionError: friendSpec → i: i failed for 18 at [age]. which could be improved to AssertionError: friendSpec → age: s.spec.number failed for 18 at [age]. for instance.
Hello again, just logging here a potential improvement of the error message for
s.spec.number.I have:
and (using the new js-spec-chai:
I receive
AssertionError: friendSpec → i: i failed for 18 at [age].which could be improved toAssertionError: friendSpec → age: s.spec.number failed for 18 at [age].for instance.