30 Days of API Testing Day 16: Complete Exercise 2

I completed this exercise in Postman. It took me some time to figure out how to get token from cookies and use assertions.

I also learned how to run Postman collection using Newman

This page was useful Postman JavaScript Reference

Anyone can explain me why this test always passes? In response I can see only cookie named β€œtoken” (Postman).

pm.test("4. Cookies has token", function () {
  pm.expect(pm.cookies.has('no-such-cookie-name')); 
//for some reason this is always true
});