Metric/Imperial converter works as intended but doesn't pass the last two tests

Tell us what’s happening:
Im dealing with the metric/imperial converter since 3 days ago. the problem is that when i does it in Glitch, pass all the tests except for the invalid number and invalid unit. When i does it in repl.it, pass all the test except for the last two. The proyect is supposed to work as intended

Your code so far
On Repl.it
https://repl.it/@JuanMartinez34/boilerplate-project-metricimpconverter-1#server.js
On Glitch
https://glitch.com/edit/#!/fcc-metric-imperia
Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36.

Challenge: Metric-Imperial Converter

Link to the challenge:

hey @h_juanmar, I encountered the same exact problem.

I realized that on Repl.it, you need to create a new “.env” file and put your 'NODE_ENV=test" variable in it, to trigger the testing. In Repl.it, all the .env standard variables come in “sample.env”, and for some reason references to .env in the server doesn’t read the items in sample.env.

So, just create a new .env file, and put in the variables, and that should trigger the function and unit tests.

This issue should be flagged earlier by FCC, I think a lot of folks get confused by this*.

1 Like