Tell us what’s happening:
Once I run my project for test cases it fails on 2 cases, which pass without any problem when I manually check it. Could you please test the below project Your project link(s)
Here is the repl source code:project source
Could you run test with opening Chrome Developer tool?
Maybe you can find two error messages at JavaScript console, like this:
frame-runner.js:98 Error: expected '1.60934' to be a number
at eval (eval at <anonymous> (frame-runner.js:84), <anonymous>:24:11)
This is because your return value, returnNum, should not be String but Number.
Since these 2 tests use the assert.approximately(...) statement, returnNum is expected to be a number.
// Values can be converted to numbers using the Number() function.
returnNum = Number(returnNum);
res.json({"initNum":initNum,"initUnit":initUnit,
"returnNum":returnNum,"returnUnit":returnUnit,"string":resultString});
The other test statements accept the string value (exp. “123”, “234”), so I think it would be nice that above 2 test explicitly convert the type (string to number)