Hi there, I am trying to complete the issue tracker project but I cannot pass the functional testing section. I pass the first three tests but others are failing. Problems are listed below:
Some of test logs are saying “unexpected undefined to equal to my expected results”. But when I test in apps. The results can show up as expected. So I can’t understand why this is happening…
TypeError on res.body.forEach is not a function
Is it because the res.body is an object so I cannot use the forEach method? Should I use the
Object.keys method to turn them into array so that I could use for each in the functional test?
‘expected 404 to equal 200’
You can try run my project to see the error logs…
Here is the link to my project:
Thank you for viewing or any attempts in solving the problems :’(
forEach is an array function, you should not be using it on objects like response.
When I look at your functional tests, I have caught some typos at first glance.
For instance, you fail the test
'1) Functional Tests
GET method tests
Uncaught AssertionError: expected 404 to equal 200
+ expected - actual'
When I look at your api, I see that you are responding to get requests to /api/issues/test
However in your functional tests you are trying to send request to /api/issue/test.
Because you do not have a route handler for /api/issue/test, you get an 404 error.
Because most of your errors are due to a typo, I cannot further provide you any help.
Come back after you fix the typos, so I can be of better help.
Thank you so much!!! I now passed it:'D
You saved me :DDD
Copy and paste my own typo code produces multiple typo xD so scary lmao