jsonTypes false positive with array path and extra keys
prabhash-c opened this issue · comments
frisby.fromJSON({"data": [{"user": "tom"},{"user": "jack"}]}) .expect('jsonTypes', 'data.*', {user: Joi.string(), hack: Joi.number()})
This should fail, but it doesn't.
If hack
is required, do the following:
frisby.fromJSON({
"data": [
{"user": "tom"},
{"user": "jack"}
]
})
.expect('jsonTypes', 'data.*', {
user: Joi.string(),
hack: Joi.number().required(),
})
https://hapi.dev/module/joi/api/#anyrequired---aliases-exist