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
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