expect with **jsonTypes**, passes test even if the Key doesn't exist
spatchamatla opened this issue · comments
expect with jsonTypes, passes test even if the Key doesn't exist in JSON response
.expect('jsonTypes', {
name: Joi.string(),
businessKey: Joi.string(),
type: Joi.string()
})
test passed even if the Key type
doesn't exist in JSON response
use required()
.
.expect('jsonTypes', {
name: Joi.string().required(), // required
businessKey: Joi.string(), // optional
type: Joi.string() // optional
})
@H1Gdev Thanks. That helped