vlucas / frisby

Frisby is a REST API testing framework built on Jest that makes testing API endpoints easy, fast, and fun.

Home Page:http://frisbyjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

@spatchamatla

use required().

.expect('jsonTypes', {
   name: Joi.string().required(), // required
   businessKey: Joi.string(), // optional
   type: Joi.string() // optional
})

@H1Gdev Thanks. That helped