Quality Assurance Projects - Metric-Imperial Converter

Tell us what’s happening:

glitch issue: I pass all the fcc tests except for these two:

  • If the number is invalid, returned will be 'invalid number'.
  • If both the unit and number are invalid, returned will be 'invalid number and unit'.
    I read on this forum that there may be an issue on how glitch handles numbers. So I tried to run the project on replit.

replit issue:

  1. If I run the server with NODE_ENV secret key, my tests are passing (I can see that on the console). BUT if I pass the live solution to FCC all fcc tests fail with time out.
  2. If I run the server without NODE_ENV secret key, I pass all the fcc tests except these two:
  • All 16 unit tests are complete and passing.
  • 5 functional tests are complete and passing.

So I can either

  • run the server, my tests and the fcc tests on glitch and fail the fcc number format test,
  • run the server without my tests on replit and fail the fcc unit and functional tests.
  • run the server with my tests on replit and fail all the fcc tests,

Can you tell me how to get this project to work with either solution please. Thanks in advance.

Your code so far
glitchLink: https://freecodecamp-mariamawit-metric-imperial-converter.glitch.me/
replitLink: https://boilerplate-project-metricimpconverter.mariamawitashen.repl.co
repository: GitHub - Menigedegna/boilerplate-project-metricimpconverter: A boilerplate for a freeCodeCamp project.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Quality Assurance Projects - Metric-Imperial Converter

Link to the challenge:

I’m having the exact same issues. Do you have your CORS package/headers properly set?

Thanks for your reply @davidsantana980 . I think my CORS set up is fine because in both glitch and replit I can pass few tests. If it was a CORS issue I shouldn’t be able to pass any tests right?

Here is what I found after some troubleshooting:

  • glitch: does some pre-processing on query. So when we try for host/api/convert?input=2//5mi, req.query =2/5mi. So my code doesn’t return “invalid number”. This is why I am failing the 2 FCC tests.
  • replit: the functional test code was messing with the server. In replit, chai
    .request(server) works when server=theReplitLink, which is the link below btw. I deleted and restarted a new replit.

replitLink: https://boilerplate-project-metric-converter.mariamawitashen.repl.co


You’re a genius! I wouldn’t have come up with that. Solved my problems too.

@mariamawit.ashenafi2, Thank you so much! I’ve been wrestling with this for so long. Locally, I passed every test, but FCC won’t give me the “complete prompt”.

Thanks again. I can finally stop losing my hair over this. lol.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.