vdespa / introduction-to-postman-course

956 stars 597 forks source link

Field current-stock needs to be update #7

Closed pankajbhasker closed 2 years ago

pankajbhasker commented 2 years ago

Get Book Api {{baseUrl}}/books/:bookId response has field "current-stock" which is giving error while using it in post man unit test. Here is my test case:
const response = pm.response.json(); console.log('books response : ', response); const currentStock = response.current-stock; pm.test("Checking if stocks is available ", () => { pm.expect(currentStock).to.be.above(0); });

ERROR I am getting is "ReferenceError: stock is not defined" Kindly update the field while returning response as currentStock instead current-stock

pankajbhasker commented 2 years ago

Not an Issue can be close for now.

vdespa commented 2 years ago

This is the point of the exercise :)

pankajbhasker commented 2 years ago

I was doing exercise on go, though to update you as soon as possible but just after few min realize the point.