Metric/Imperial Converter unit and functional tests

i know no one ever replies anymore lemme just put this out incase…

fcc2


dont know why fcc is not passing these for me, both unit and functional tests along with every other stuff passed in my repl console, my imperial converter works just fine, bt fcc seems not to be passing just these for me even tho its showing on the fcc page that both are complete and passing…
what do i need to do?

Asking for project feedback without providing the project, for sure will not get any feedback. Where’s your replit or github link to your project?

Thanks sensei shugyoza for your feedback. https://boilerplate-project-metricimpconverter.6ix-ville.repl.co or this https://replit.com/@6ix-Ville/boilerplate-project-metricimpconverter#tests/1_unit-tests.js

Have you inputted NODE_ENV as key, and test as value in the padlock icon?
If it still does not pass the 16 unit tests, you probably need to console log all the inputs and outputs in each function, to see what the specs input and what your functions output.

console logged all what you said to do…console marks everything green, no error, 21 tests passing. still fcc doesnt pass the 16 unit tests

21 tests passing could mean that your functions has been thoroughly tested and passed OR your test specs has flaws. e.g:

  test('Invalid input (double fraction)', function(done) {
    let input = '3/2/3L';
    assert.equal(convertHandler.getNum(input), undefined);
    done();
     console.log(input);
  });

What the user story asked for you to return if input is invalid number?
When I said console.log input and output, I meant to do the debugging on your controller function, not your test units.

Did you get this kind of result? Or still


only the first two checked?

You’ve changed the format in your unit tests file. The test that checks for passing unit tests assumes all 16 tests are in one suite, with the correct name, in the unit tests file. You’ve reformatted it and you actually have several suites. Check to the original boilerplate to get the original name and make sure all the tests are in the one suite.

Tried this…just 16 units test not passing in fcc…and its saying 12passing in repl console not the initial 21 passing

nope…i refreshed repl, all these passed except the 16unit tests

I told you the bits you’re missing to pass the test. What the user stories asked you to return for invalid inputs? what your test specs is testing for the return value on invalid inputs? And what your controller function’s return value for invalid inputs?.

yeah i get it now…this has something to do with convertHandler getNum function or the regex…my converter never returns “invalid number and unit” or “invalid number” even when i test non-numeric characters against valid/invalid units. ill have to a break from this, dont really know how go abt it. thanks so much.

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