Cannot pass functional testings in Issue Tracker Project

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:

Problems:

  1. 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…

  2. 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?

  3. ‘expected 404 to equal 200’

You can try run my project to see the error logs…
Here is the link to my project:
https://repl.it/join/wykjxcfd-snowiewdev

Thank you for viewing or any attempts in solving the problems :’(

Hello there,

Yes 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
no filter:

  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.

Good luck :grin:

1 Like

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
Thank you :slight_smile:

1 Like