After successfully converting an excel sheet's content into a JSON format, my next task is to perform some validation on it.
The requirement is to ensure that the jsonData
variable contains specific keys in a particular order: Breakfast
, Lunch
, Snack
, and Dinner
.
To start with the assertion process, I attempted the following test:
const jsonData = [{
"Breakfast": "Cereal",
"Lunch": "Chicken",
"Snack": "Biscuit",
"Dinner": "Pork",
"Drinks": "Water"
}]
expect(jsonData).to.be.an('array').that.contains.keys('Breakfast')
Unfortunately, running this code resulted in an error: https://i.sstatic.net/3XJuF.png