Tell us what’s happening:
I’m really having trouble with this challenge. I get 13 of the 21 tests to pass, the failed tests all mention TypeError. Feel like I’ve missed something. Also when I go to the solution link and press convert on any input, nothing happens. I’m not sure what I missed.
Any help would be appreciated. I don’t really understand why it doesn’t work. One thing I found is that when i add the /api/convert?input=4gal to the end of my url, it comes up with Not Found on the page. When I look at the code, the only place where Not Found is found is in Server.JS under //404 Not Found Middleware. But still not sure why this is happening.
The reason it returns Not Found, is because your route in api.js (api/convert) is missing a slash.
You have the same error in your functional tests.
In your tests you also made some errors accessing array elements. In some cases you used some_array(index), while in other instances you used the correct some_array[index].
If you fix these errors, there are only two failing tests left. The error messages for these should give an indication as to what you have to fix.
Arrgh I knew it was something I missed. Thanks for the help Ben, really appreciated. All tests passing now, but for some reason, freecodecamp is failing 1 test, see screenshot.
Thanks Ben, would have never thought to check that. Just moved my closing brackets for that suite to the bottom and it passes now. Thanks again for all your help.