Test Driven Development - Cannot read property 'status' of undefined

Hi all,
I’m at 5-Testing the Authorization of Test driven development. I’m sure my code is exactly the same as in the lecture, but I’ve hit this snag on the first test.

It “Should return 401 if client is not logged in” but the test keeps failing, apparently res is undefined. I’ve compared it to the other routes, seems right… Has anyone else encountered this problem?

I found the problem by putting console.log’s in everything, and the POST function wasn’t being triggered, although it was being triggered with postman. I deduced that the test had the problem, and upon comparing it to tests which WERE working I discovered the bug.

My bad!