Metric-Imperial Converter project example not working

Hello,

When I go to the Metric-Imperial Converter project and click on the FCC staff example, it leads to a directory instead of the project. I’ve only got one computer to test this with so I’m not sure if I’m doing something wrong or if the project example is truly broken.

Thank you,

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like

Great, I found an open issue here: https://github.com/freeCodeCamp/freeCodeCamp/issues/34504.

Per the users in the thread, this issue has been ongoing for over 7 months. (A month ago, a user mentioned it had been going for 6 months).

1 Like

Hey @UniqueNoSpacesShort . I feel you.

I just wrapped up working on my project for this challenge tonight. I managed to get the test suite working and got my code to pass all the tests that come packaged with the boilerplate.

Hopefully my project helps serve as an example for you: my Metric-Imperial Converter.

As an aside, while exploring the boilerplate code at the start of my project, and trying to make heads or tails of it, I figured out that the tests in the boilerplate code are enabled by defining the .env variable NODE_ENV=test.

As soon as you add the NODE_ENV=test variable (or un-comment it if you typed it in earlier), the FCC testing code in the boilerplate will run, providing lots of information in the server console.

When I first “activated” the tests, only 10/21 of the unit and functional tests were passing for me. After working through the error messages from the test suite with the help of lots of console.logs, I was able to get them all to pass (see below for what you’re hoping to see in your console one day soon :slight_smile: ).

Listening on port 3000
Running Tests...

  Unit Tests
    Function convertHandler.getNum(input)
      ✓ Whole number input
      ✓ Decimal Input
      ✓ Fractional Input
      ✓ Fractional Input w/ Decimal
      ✓ Invalid Input (double fraction)
      ✓ No Numerical Input
    Function convertHandler.getUnit(input)
      ✓ For Each Valid Unit Inputs
      ✓ Unknown Unit Input
    Function convertHandler.getReturnUnit(initUnit)
      ✓ For Each Valid Unit Inputs
    Function convertHandler.spellOutUnit(unit)
      ✓ For Each Valid Unit Inputs
    Function convertHandler.convert(num, unit)
      ✓ Gal to L
      ✓ L to Gal
      ✓ Mi to Km
      ✓ Km to Mi
      ✓ Lbs to Kg
      ✓ Kg to Lbs
  

  Functional Tests
    Routing Tests
      GET /api/convert => conversion object
        ✓ Convert 10L (valid input) (150ms)
        ✓ Convert 32g (invalid input unit) (105ms)
        ✓ Convert 3/7.2/4kg (invalid number)
        ✓ Convert 3/7.2/4kilomegagram (invalid number and unit)
        ✓ Convert kg (no number)
  

  21 passing (510ms)

Hope this helps you and anyone else out there who has had to muddle their way through the lacking instructions/examples for this project.

5 Likes

Hey there JulianNF,

After my frustrations, I left FCC for a while. I think I’ll give it a try again and I’m happy to see your message with your project as an example! Thank you for this! :slight_smile:

1 Like

Hi! Glad to see that you’re back!

Keep giving it a try and figure out how to make the challenge work for you. I’m happy to report that I finished up all of the projects a few weeks ago, so don’t give up yet!

Leave a message if you’re still confused about what needs to be done, and I’ll do my best to help you progress. :smiley:

2 Likes