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, pass all the test except for the last two. The proyect is supposed to work as intended

Your code so far
On Glitch!/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, you need to create a new “.env” file and put your 'NODE_ENV=test" variable in it, to trigger the testing. In, 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