-
Notifications
You must be signed in to change notification settings - Fork 13
Integer failure error can be improved #31
Copy link
Copy link
Open
Labels
Description
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.
Reactions are currently unavailable