I using chai.should();
for writing node js test case. I am calling REST API and getting the response
{
"statuscode": 200,
"message": "success",
"data": {
"getEducationDetails": [
{
"end_date": "1996-04-31",
"degree_name": "BE",
"degree_date": "1993-06-18",
"location": "Hyderabad",
"university_name": "Hyderabad",
"institute_name": "VIT",
"start_date": "1992-01-01"
}
]
}
}
I want to test the statuscode in the response is 200 or not and proprieties like location etc.
I have tried
res.body.should.have.property('data')
.which.is.an('object')
.and.has.property('getEducationDetails')
.which.is.an('array')
.and.has.property('location')
.and.has.property('location')
and for stauscode
res.body.should.have.property('stauscode').eql(200)
how can I test these properties?
Thank You in Advance